• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using log4j in jsr portlets

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/
reply
    Bookmark Topic Watch Topic
  • New Topic