GeeCON Prague 2014*
The moose likes JBoss/WildFly and the fly likes JBoss 7.1.1.Final - Log4j - EAR File application - Logging not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss 7.1.1.Final - Log4j - EAR File application - Logging not working" Watch "JBoss 7.1.1.Final - Log4j - EAR File application - Logging not working" New topic
Author

JBoss 7.1.1.Final - Log4j - EAR File application - Logging not working

Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 59
Friends,

I found few details about the log4j configuration.

We do have few application already running on JBoss 3.x and I am migrating them to JBoss 7.1.1.Final.

Few of the WAR file, JAR files and EAR files. I found some documents to configure the Log4j within JBoss.

It worked great with WAR files. Still, I couldn't make it work on EAR files.




I can't use JBoss logging because it is a big application and all classes using Log4j. Now, what is the best place for log4j.properties?

I can have all EAR classes Logging to 1 configuration....
Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 59
I have fixed it. 2 solutions.

1. add log4j.xml in to a blank jar and place it on EAR/lib directory.
2. Create a custom module which just has log4j.xml and module.xml. Include that module on JBoss deployment structure xml file. It will be picked up.

Good luck buddies. If anyone need more information, I will post the solution code here later.
BingBing Wang
Greenhorn

Joined: Apr 23, 2013
Posts: 2
Santhosh,

I created a custome module which has log4j.xml and module.xml. The module is included on JBoss deployment structure xml file. But I did not see the log created in the defined directory.

Please give me some pointers when you get a chance.

Thank you!
Santhosh Kalisamy
Ranch Hand

Joined: Apr 15, 2008
Posts: 59
BingBing Wang wrote:Santhosh,

I created a custome module which has log4j.xml and module.xml. The module is included on JBoss deployment structure xml file. But I did not see the log created in the defined directory.

Please give me some pointers when you get a chance.

Thank you!


Hi Wang,

could you please paste here (or new thread and give me the link) your log4j.xml, module.xml with module directory structure and jboss-deployment-structure.xml.

Will see, how can I help...

Good Luck!
BingBing Wang
Greenhorn

Joined: Apr 23, 2013
Posts: 2
Santhosh,

Thank you for your reply. I actually found the code you posted on this link https://community.jboss.org/thread/219871

It is really helpful. I configured my external logging module as the one you posted. It works fine.

Thank you so much!!!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

"BingBing Wang" please your your private messages regarding an important administrative matter.


JBoss In Action
 
GeeCON Prague 2014
 
subject: JBoss 7.1.1.Final - Log4j - EAR File application - Logging not working