{"id":3765,"date":"2012-02-06T21:10:59","date_gmt":"2012-02-06T15:40:59","guid":{"rendered":"http:\/\/windowsvj.com\/wpblog\/?p=3765"},"modified":"2012-02-06T21:10:59","modified_gmt":"2012-02-06T15:40:59","slug":"log4jwarn-please-initialize-the-log4j-system-properly","status":"publish","type":"post","link":"http:\/\/windowsvj.com\/wpblog\/2012\/02\/log4jwarn-please-initialize-the-log4j-system-properly\/","title":{"rendered":"log4j:WARN Please initialize the log4j system properly"},"content":{"rendered":"<p>Recently I was trying to implement logger concept in my java application.   <br \/>While executing the java program I encountered an Exception:<\/p>\n<p><strong>log4j:WARN No appenders could be found for logger (Log4jTest.Test).     <br \/>log4j:WARN Please initialize the log4j system properly.<\/strong><\/p>\n<p>To fix this issue you need to create a &quot;log4j.properties&quot; file and add it to the classpath for your Eclipse project. To add a property file to classpath :<\/p>\n<p>1. create a log4j.properties file like this:   <br \/>log4j.rootCategory=TRACE, CONSOLE    <br \/>log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender    <br \/>log4j.appender.CONSOLE.Threshold=INFO    <br \/>log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout    <br \/>log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n    <br \/>2. zip the file and rename it .jar (log4jprops.zip =&gt; log4jprops.jar), put the file in a folder you like (example: \/workspace\/log4jprops\/log4jprops.jar)    <br \/>3. in Eclipse: Run, Debug, click the configuration you want, select Classpath tab    <br \/>4. click on the User Entries item in the tree view to select it    <br \/>5. click advanced, select &quot;Add Classpath Variables&quot; radio, and click OK    <br \/>6. select or create a variable named LOG4J_PROPS, and point it to the JAR created before.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was trying to implement logger concept in my java application. While executing the java program I encountered an Exception: log4j:WARN No appenders could be found for logger (Log4jTest.Test). log4j:WARN Please initialize the log4j system properly. To fix this issue you need to create a &quot;log4j.properties&quot; file and add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[258],"tags":[],"class_list":["post-3765","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/posts\/3765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/comments?post=3765"}],"version-history":[{"count":1,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/posts\/3765\/revisions"}],"predecessor-version":[{"id":3766,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/posts\/3765\/revisions\/3766"}],"wp:attachment":[{"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/media?parent=3765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/categories?post=3765"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/windowsvj.com\/wpblog\/wp-json\/wp\/v2\/tags?post=3765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}