0

I have log4j in my JAVA application and when I call an external WebService, I have many debug logs of this webservice. Can I disable these logs ?

(I want of course keep all the other logs of my application and I disable only the one for Webservice call method)

Thank you very much

Learthgz
  • 133
  • 12

2 Answers2

0

For the classic log4j (1.2):

Via Configuration

Suppose we are no longer interested in seeing the output of any component belonging to the com.foo package. The following configuration file shows one possible way of achieving this.

# ...Irrelevant config...

# Print only messages of level WARN or above in the package com.foo.
log4j.logger.com.foo=WARN

If you want to do this programmatically, refer to the earlier part of the link above.

billc.cn
  • 7,187
  • 3
  • 39
  • 79
0

Duplicate of Disabling Log4J Output in Java

Set level to OFF (instead of DEBUG, INFO, ....)

Community
  • 1
  • 1
cahen
  • 15,807
  • 13
  • 47
  • 78
  • It will disable logging for all my application, how can I disable it only for a method (calling webservice method) – Learthgz Aug 06 '15 at 15:54