[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3151
  • Last Modified:

How to disable log4j for web app? (Java/J2EE) ?

Hi,

I hava a log4j.properties file as:

# Set root category priority to DEBUG and its only appender to LOGFILE.
log4j.rootCategory=DEBUG, LOGFILE

# LOGFILE is set to be a File appender using a PatternLayout.
# logfile -- DailyRollingFileAppender
log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logfile.File=D:\\Group_EOB\\Group_EOB.log
log4j.appender.logfile.DatePattern='.'yyyy-MM-dd

log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=D:\\Group_EOB\\Group_EOB.log
log4j.appender.LogFile.DatePattern = '.'yyyy-MM-dd-HH-mm
log4j.appender.LOGFILE.Threshold=DEBUG
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-5p [%d{MM/dd/yy - HH:mm:ss}] [%F:%L] ----- [%m]%n


My BIG Question is how do I disable this logging for the log4j ???
We are using Websphere app server to deploy the web app??

Thanks and regards,
_Esam
0
_Esam
Asked:
_Esam
  • 4
  • 2
  • 2
3 Solutions
 
CEHJCommented:
Change DEBUG to ERROR or FATAL
0
 
CEHJCommented:
ERROR was an error ;-) Just FATAL
0
 
_EsamAuthor Commented:
That's not disabling ??

That's just changing the Level ?? right?

_Esam..
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
malfunction84Commented:
I'd suggest that you change the level to OFF, not FATAL.

Changing the level is as good as disabling.  log4j is optimized so that logging calls with a level below what is set for that category return almost instantly, so they barely take any time at all.

The alternative is to remove all the log4j calls from your code, but that defeats the entire purpose of log4j.
0
 
CEHJCommented:
>>That's just changing the Level ?? right?
Yes, but why would you not want FATAL errors reported?
0
 
_EsamAuthor Commented:
>>I'd suggest that you change the level to OFF

Is there a Level OFF ???
I thought the Levels were FATAL, ERROR, WARN, DEBUG AND INFO

Thanks.
_Esam.
0
 
CEHJCommented:
:-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now