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 logging in one file only Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "logging in one file only" Watch "logging in one file only" New topic

logging in one file only

Andreas Groscurth

Joined: Mar 08, 2004
Posts: 12

i use the TCLFilter in the jboss-log4j.xml file to log my web application (as described in

I dont use the category solution because of
f you have multiple apps with shared classes/categories, [...] then this approach will not work

My problem now is that it logs into the log file AND on the console. I dont really like to remove the whole from the root tag, so is there another way to tell the logger to not log my web application on console ?

Thanks for help
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

You can set the "additivity" attribute to false on your logger/category configuration in the log4j.xml. Example:

[My Blog] [JavaRanch Journal]
Andreas Groscurth

Joined: Mar 08, 2004
Posts: 12
thanks mate... first it didnt work, but i forgot to add the appender-ref to that category - now it does
Sriram Venkatesan P

Joined: Aug 16, 2006
Posts: 5
We are planning to use TCLFilter in Jboss 4.x to prevent logs being written into the server.log file of Jboss ( Currently our application logs are written into Server.log and this increases the size of the server.log). So, I would like to request senior members in this forum to comment, if there would be any performance hit /issue if we configure TCLFilter? Is it advisable to use TCLFilter to Filter out/Stop Unwanted logging into server.log in production based environments? Your replies would be highly appreciated.

Thanks in Advance

Thanks and Regards,<br />Sriram
I agree. Here's the link:
subject: logging in one file only
It's not a secret anymore!