File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes using log4j in jsr portlets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "using log4j in jsr portlets" Watch "using log4j in jsr portlets" New topic
Author

using log4j in jsr portlets

Praveen Raj
Greenhorn

Joined: Jun 17, 2008
Posts: 8
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

Joined: Jul 30, 2008
Posts: 43
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using log4j in jsr portlets
 
Similar Threads
Where is the log message written?
Not able to send data from one struts portlet to another struts portlet
Subtle, subtle, little Log4j difficulty
Debugging Best Practices??
how to log errors occurred in backend java engine or servlet