• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

how to disable the log  RSS feed

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!