Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

liberty profile control logging

I cannot control logging levels for my code in Websphere Liberty Profile server. I have configured the server.xml on the server not to log hibernate and spring, since my logs will get flooded with activity from those two frameworks. I commonly do this using log4j and it works fine in standalone WAS.

<logging consoleLogLevel="INFO" copySystemStreams="true" traceFormat="ENHANCED" traceSpecification="org.springframework.*=off:com.ibm.ws.*=off:org.hibernate*=off"/>

In Liberty this does not work. I get the following log when liberty updates the configuration (when I save server.xml with the changes):

[INFO ] TRAS0040I: The configured trace state included the following specifications that do not match any loggers currently registered in the server: org.hibernate*=off:org.springframework.*=off

Basically this message applies to any of my code and any third party code (Spring, Hibernate, etc). However the traceSpecification levels work fine for the IBM classes, and I'm able to specify *=off, which effectively turns off all logging.

Has anyone experienced this? IBM's documentation for TRAS0040I seems simple enough, but I can't seem to figure out why my loggers are not getting registered with the server.

like image 636
user3537207 Avatar asked Nov 17 '25 20:11

user3537207


1 Answers

Liberty doesn't have a rich control on logging. You should understand the difference between "logging" and "tracing". Check description of console.log, messages.log, trace.log files at the beggining of: http://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/rwlp_logging.html

Your configuration in "traceSpecification" - actually will do nothing, as spring and hibernate are logs from JVM and they doesn't go to trace, so trace configuration doesn't affect them.

All you can configure in liberty for jvm logs is consoleLogLevel (INFO, AUDIT, WARNING, ERROR, and OFF)

If you want to configure log levels for specific components in Liberty - you should use for example log4j with own configuration

like image 182
StrekoZ Avatar answered Nov 20 '25 14:11

StrekoZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!