• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using log4j in jsr portlets

 
Praveen Raj
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
can anyone help me in using log4j(Apache log4j) in portlets.
Are the files log4j.xml and log4j.properties a must,
should i change something in the web.xml


thanks
praveen
 
Sumeet Singh Aryan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI parveen,
if you are using Jboss Portal 4.2 or 5.0 then just go through the following stuff:

�Set the LOG4J_PATH environment variable to �C:\� or anything else where you want to create the log file.
�Place the log4j.jar file in your \WEB-INF\lib
�In your JBOSS_INSTALL/bin directory there will be a file called run.conf. Around line 42 (+tee hee+) you will see a JAVA_OPTS variable declaration.

All you have to do is add the following property to the file:
-Dorg.jboss.logging.Log4jService.catchSystemOut=false
�in your jboss-web.xml inside your WEB-INF put the below code:
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
log4j.test:loader=testJSFPortlet.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
�put log4j.properties file in src/java/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic