aspose file tools*
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
Author

logging in one file only

Andreas Groscurth
Greenhorn

Joined: Mar 08, 2004
Posts: 12
Hi,

i use the TCLFilter in the jboss-log4j.xml file to log my web application (as described in http://wiki.jboss.org/wiki/SeparatingApplicationLogs).

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
Andreas
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10096
    
164

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



[My Blog] [JavaRanch Journal]
Andreas Groscurth
Greenhorn

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
Greenhorn

Joined: Aug 16, 2006
Posts: 5
Hi,
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: http://aspose.com/file-tools
 
subject: logging in one file only