MonitorLizard
MonitorLizard

Reputation: 157

Disable unwanted INFO-Messages from SOAP Logger

In question Filter unwanted INFO-Messages from Logger it is proposed to disable unwanted SOAP INFO logging by raising the respective log level to WARNING like so:

// Disable SOAP-internal INFO logging
Logger.getLogger("javax.enterprise.resource.webservices.jaxws.server").setLevel(Level.WARNING)

URL url = new URL("http://localhost:9999/ws/SoapControl?wsdl");
QName qname = new QName("http://example.ch/", "SoapControlImplService");

Service service = Service.create(url, qname);
SoapControl soapControl = service.getPort(SoapControl.class);  // Unwanted logging happens here

This usually works, but unfortunately not all the time, i.e. the behavior is not deterministic.

Any ideas? Thanks!

Upvotes: 0

Views: 1273

Answers (1)

jmehrens
jmehrens

Reputation: 11055

Looks like you might be running into garbage collection of loggers. Pin the soap logger with a static final reference or you can add an entry into your logging.properties file to control the level on demand. Every time the logger is recreated the log level is read from the properties file.

Upvotes: 1

Related Questions