Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logging in one file only

 
Andreas Groscurth
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the "additivity" attribute to false on your logger/category configuration in the log4j.xml. Example:

 
Andreas Groscurth
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mate... first it didnt work, but i forgot to add the appender-ref to that category - now it does
 
Sriram Venkatesan P
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic