File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 10441

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.

I agree. Here's the link:
subject: JBoss & Log4j
It's not a secret anymore!