File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes how to disable the log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "how to disable the log" Watch "how to disable the log" New topic
Author

how to disable the log

shyam sunder prasad
Ranch Hand

Joined: Mar 23, 2011
Posts: 62
hi friends,

i am using log4j in my application . if suppose i want to disable the log then what i have to do?

i mean ,any property is there to disable the log. please help me.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

First, please use code tags when posting source code, it makes the source much easier to read. I edited your post for you this time.

As far as turning off the logging, a few ways:

a) Delete the log4j.xml file. If it is not there, logging will not be initialized. Though Log4J does complain about not finding a config file.
b) Create an appender that uses org.apache.log4j.varia.NullAppender. Then change the <root> and the <logger> entries to all reference the null appender. (A variation of this theme is to change all of the currently-defined appenders to used NullAppender.)
c) Change the levels or threshold levels of either the appenders or loggers to OFF.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to disable the log
 
Similar Threads
Help? - Reloading log4j.xml config without jboss restart
struts 2 and log4j
Capture logs to file via log4j.xml
How to supress SQL Queries in log file
Log4j doesn't split the log files as it supposed to