using log4j in jsr portlets

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

posted 8 years ago

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/

The woods are lovely, dark and deep, But I have promises to keep; And miles to go before I sleep, And miles to go before I sleep. - Robert Frost