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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss & Log4j" Watch "JBoss & Log4j" New topic

JBoss & Log4j

Tom Simmons

Joined: Nov 16, 2010
Posts: 11
Having found the JBoss forums to be pretty much useless, I'm hoping someone here can help me.

A few years back worked on a project using Tomcat and JSP, the Log4j set up was such that we had a properties file that listed a couple of appenders and lots of loggers. We created a logger entry for each new class or section (more often) of the program we wrote. The beauty of this was that we could set the logging to Warn or similar for older established code, and set it at Debug for new code or when someone reported a problem.

Under JBoss (5.1 GA) the code I have inherited for a current project has a line in each class ...

private static final Logger log = Logger.getLogger(ClassFolder.class);

Which I understand is creating a logger for the class, there is then a default appender defined as standard in the JBoss installation so the granularity is set for all output.

I know that you can create multiple appenders in the JBoss Log4j conf file, and I know you can control the logging level for specified types etc. What I'd like to do though is set up something like I used to have where all configuration is part of the project.

Does anyone understand what I'm looking for and know how to do it?

Jaikiran Pai

Joined: Jul 20, 2005
Posts: 9957

Since your post in the JBoss forum had much more details on what you wanted, I just replied there

[My Blog] [JavaRanch Journal]
Tom Simmons

Joined: Nov 16, 2010
Posts: 11
Thanks, I'll take a read and reply over there.

subject: JBoss & Log4j
Similar Threads
what does log4j info level mean
Logger for each Thread
EJB Logging
this and static don't mix
New to log4j - need some advice