Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Santhosh Kalisamy
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"BingBing Wang" please your your private messages regarding an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic