Topic
  • 2 replies
  • Latest Post - ‏2012-10-30T10:39:31Z by SystemAdmin
SystemAdmin
SystemAdmin
345 Posts

Pinned topic Logging for individual DWL components.

‏2012-10-29T13:53:46Z |
Hi,

The below snippet is taken from log4j.properties and am trying to understand how to leverage this feature.

  1. Un-comment the line below to enable logging for DWL components.
  2. To limit the output make the package name more specific.
  3. Add more entries like the one below to enable logging for multiple packages.

#log4j.logger.com.dwl=ERROR, file, stdout

Can someone kindly help me in understanding how this component of log4j.properties work and what is it supposed to do? My understanding is that this part helps me in overriding the root logger threshold for the package that I have configured. I have been trying to make this work, but just not getting any breakthrough.

Thanks in advance.
Updated on 2012-10-30T10:39:31Z at 2012-10-30T10:39:31Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    345 Posts

    Re: Logging for individual DWL components.

    ‏2012-10-30T06:43:31Z  
    Hi Sushil,

    If you make a copy/uncomment this line and change the ERROR statement to ALL or DEBUG you will see more debug information in your dedicated log file or if the reference is missing it should re-direct to your console / SystemOut.log.

    If you make the package name more specific you can specify a logging level per package.

    Cheers,

    Bart
  • SystemAdmin
    SystemAdmin
    345 Posts

    Re: Logging for individual DWL components.

    ‏2012-10-30T10:39:31Z  
    Hi Sushil,

    If you make a copy/uncomment this line and change the ERROR statement to ALL or DEBUG you will see more debug information in your dedicated log file or if the reference is missing it should re-direct to your console / SystemOut.log.

    If you make the package name more specific you can specify a logging level per package.

    Cheers,

    Bart
    So was my understanding incorrect? The general behaviour of log4j is that the logging level of a class is determined from what is set in the class itself or of its partent. If the logging level is not defined anywhere, the logging level of the root logger is taken. So what I assumed this package structure helps me do is override the root logger logging level. For instance, if my root logger logging level is set to ERROR and I define the log4j.logger.com.dwl.tcrm.coreparty.controller = ALL , all the classes under this package structure should start logging with the logging level of ALL. But any package outside this package, should still have a ERROR as the logging level.