permaculture playing cards*
The moose likes JBoss/WildFly and the fly likes setting up log4J for application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "setting up log4J for application" Watch "setting up log4J for application" New topic
Author

setting up log4J for application

Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202
I have a requirement to configure log4j for a application available in myapp.war. so i created my own log4j properties file and used the same by calling in different class files.

Now i deployed myapp.war file in default/deploy folder of jboss 5.0.1 server and accessed the application, immediately server console appender started looping and logging was failed.

As jboss already has default log4j appender, can you please let me know how can i achieve creating my own log4j file to activate logging action of different information/errors occurring in my application.

Please help.


Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159

I would have pointed you to a JBoss forum discussion about this exact issue, but the forums are down for maintenance now. So here's another resource where you can find this information.

[My Blog] [JavaRanch Journal]
Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202
Thanks jai kiran for giving us good article.

I followed as said in article but have got below error. can you please let me know if i am wrong any where.




and my log4j properties file looks like this



i am logging info from servlet like

logger.info("Hello");
logger.info("world");
Prakash Kumar M
Greenhorn

Joined: Jun 29, 2009
Posts: 18
Eshwar, even i tried to set up log4j to my war file but have the same problem..

Any help. please
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9930
    
159

Did you configure the jboss-web.xml for classloading isolation? Can you please post its contents? Also please post the output of:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting up log4J for application
 
Similar Threads
using log4j and WSAD 5
How to configure a separate log file(Log4j) for a specific application in JBoss?
Context Path Problem
Server loggng with log4j Tomcat 6.x
log4j: assigning logging level per appender