Topic
5 replies Latest Post - ‏2012-12-04T20:32:53Z by Art_Jolin
SystemAdmin
SystemAdmin
1485 Posts
ACCEPTED ANSWER

Pinned topic How to disable logging for custom WXS component in SystemOut.log?

‏2012-11-27T15:15:52Z |
My company is running WXS stand-alone (version 8.5).
On the container servers we have our own implementation of ReduceGridAgent. In this implementation we use java.util.logging.Logger for writing log-statements.

E.g. private Logger LOGGER = Logger.getLogger( "com.backend.reduce.ReduceGridAgentImpl" );

Our problem is that there is a lot of verbose INFO-log statements being flushed to SystemOut.log that we want to disable for the reduceGridAgent-implementation.

The log statements are written to SystemOut.log on each container server where the reduceGridAgent is invoked.

  • I've tried to use xscmd.sh -setTraceSpec -spec com.backend.reduce.ReduceGridAgentImpl=All=Disabled to disable all logging from this component, but this did not work.

  • We are currently running with these system properties:
argv11: -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager
argv12: -Djava.util.logging.configureByServer=true

  • I tried updating java/jre/lib/logging.properties with the following:
- java.util.logging.ConsoleHandler.level = SEVERE
And then restartet the container servers, but this did not prevent the info-messages from being written to SystemOut.log
Any tips to resolve this matter?
Updated on 2012-12-04T20:32:53Z at 2012-12-04T20:32:53Z by Art_Jolin
  • jhanders
    jhanders
    256 Posts
    ACCEPTED ANSWER

    Re: How to disable logging for custom WXS component in SystemOut.log?

    ‏2012-11-27T15:39:12Z  in response to SystemAdmin
    =all=disabled will disable all trace (fine, finer, finest). It will not disable all messaging logging (info, warning, error). If you want to disable info you can just use =warning=enabled or =error=enabled for your Logger in the trace spec to disable the info logging, or if you want to turn off all messaging and tracing, you could specify =off. I have not personally tried this, but I believe that is what you need to do.

    Hopefully that will take care of your problem.

    Jared Anderson
    • SystemAdmin
      SystemAdmin
      1485 Posts
      ACCEPTED ANSWER

      Re: How to disable logging for custom WXS component in SystemOut.log?

      ‏2012-11-28T11:34:35Z  in response to jhanders
      Thanks!

      I did get it to work when I provided the following traceSpec with xscmd.sh:

      xscmd.sh -c setTraceSpec -spec com.backend.reduce.ReduceGridAgentImpl=info=disabled:com.backend.reduce.ReduceGridAgentImpl=warning=enabled -cep ******* -username *** - password ***
      When I ran the xscmd command, this log message was written to the container server logs:

      11/28/12 11:35:22:610 CET 0000066c ManagerAdmin I TRAS0018I: The trace state has changed. The new trace state is *=info:com.backend.reduce.ReduceGridAgentImpl=warning.
  • andymc_
    andymc_
    16 Posts
    ACCEPTED ANSWER

    Re: How to disable logging for custom WXS component in SystemOut.log?

    ‏2012-11-28T15:22:42Z  in response to SystemAdmin
    Hi MrBee,

    I'm glad to hear that you got it working.

    In general, I would suggest dropping the "=enabled" and "=disabled" portion of the trace specification. That portion is a relic of old WAS logging code and may be more confusing than it is worth - and more verbose. Instead, try to think of each token in the trace spec as setting the logging level of one or more loggers.

    For example, the default trace spec is *(star)=info - meaning that all Loggers will log at the INFO level. If you alter the trace spec to something like com.mypkg1.*=all:com.mypkg2.*=warning, that will have the effect of setting all Loggers in the com.mypkg1 package to ALL (it will trace all log levels: info, warning, errors, debug, etc.) and setting all Loggers in the com.mypkg2 package to WARNING (which will log only warning and error messages, not info, debug, etc.). All other Loggers will log INFO and up.

    For more information on the logging in WAS and/or WXS, please see this infocenter page:
    http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Finfo%2Fae%2Fae%2Frtrb_loglevels.html

    Hope this helps,
    Andy
    • SystemAdmin
      SystemAdmin
      1485 Posts
      ACCEPTED ANSWER

      Re: How to disable logging for custom WXS component in SystemOut.log?

      ‏2012-11-29T12:41:41Z  in response to andymc_
      Hi Andy,

      Thanks for the info.
      It worked like a charm without "=enabled" and "=disabled"
      • Art_Jolin
        Art_Jolin
        26 Posts
        ACCEPTED ANSWER

        Re: How to disable logging for custom WXS component in SystemOut.log?

        ‏2012-12-04T20:32:53Z  in response to SystemAdmin
        Andy,

        One still legitimate use of the old =enabled/=disabled is to temporarily turn on/off certain bits of a trace string when you repeatedly run a test with various trace combinations. By just changing to =disabled you don't have to retype the rest of the string to enable it again later. I agree with you that most of the time this isn't important and simpler syntax is best.