This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JBoss and the fly likes Can't figure out why my log4j.log file isn't being populated 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 » Products » JBoss
Reply Bookmark "Can Watch "Can New topic
Author

Can't figure out why my log4j.log file isn't being populated

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 434
Hi,

I'm using JBoss 4.2.3.GA (can't change this), and log4j 1.2.15. I have deployed an EAR file to JBoss containing



In "myclient.jar", I have a class with this



Sadly my log message doesn't appear and I can't figure out why. Here's my log4j.properties file ...



I have verified that the parent directory exists. Any ideas why nothing is showing up in my log file? Any other ideas on how to troubleshoot this? The JBoss server log tells me the EAR got deployed successfully.

Thanks, - Dave
Guillaume Jourdan
Ranch Hand

Joined: Jul 24, 2012
Posts: 47

Your static method (or static block) is called only the first time you refer to your class (by the class loader) else your static method (or block) is never called.

Do you have a reference to this class when you deploy your application?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5541

The standard way of configuring logging in 4.2.3 is to modify the server/xxx/config/jboss-log4j.xml file. Logging config files within your EAR or WAR will not be picked up.

Also, have you seen this: https://community.jboss.org/message/198691#198690


JBoss In Action
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Can't figure out why my log4j.log file isn't being populated
 
Similar Threads
log4j: Logger does not log
log4j: Why aren't I seeing output in my log file?
New to log4j concept-log messages are not appending to logfile
Log4j Log is not created when jar file run
log4j.properties: FileNotFoundException