View Source

{section}
{column}

h1. Logging in Petals ESB

Petals uses the logger provided by the JDK.
The logger configuration file, named loggers.properties, is located in $PETALS_HOME/*conf* folder
{column}
{column:width=350px}

{panel:title=Petals logging Documentations}{children:all=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list}{panel}
{column}
{section}

h2. Petals Logger Level

Petals define a specific level: MONIT.

MONIT level can be used by log parser to monitor the exchange in Petals ESB.


The levels provided by Petals in descending order are:
* SEVERE (highest value)
* WARNING
* INFO
* CONFIG
* *MONIT*
* FINE
* FINER
* FINEST (lowest value)

The root logger level is WARNING. It means that all classes log only SEVERE and WARNING information.
You can target specific packages to collect logging from and specify a level. Here is how you would set debugging from Petals. You would need to ensure the Handler's level is also set to collect this threshold, so FINEST or ALL should be set.
{code}
##Petals level
Petals.level = FINEST

#Handler Configuration
java.util.logging.ConsoleHandler.level = FINEST
{code}
Example of configuration to debug (Level FINEST) petals-bc-soap component:
{code}
##Petals level
Petals.level = INFO #Log level for all petals services
Petals.Container.Components.petals-bc-soap.level = FINEST #Log level for petals-bc-soap component

#Handler Configuration
java.util.logging.ConsoleHandler.level = FINEST
{code}


h2. Petals formatter

Petals provides two formatter: PetalsSimpleFormatter and PetalsExtendedFormatter.

PetalsSimpleFormatter use the following pattern:
{panel:borderStyle=solid}{+}YYYY/MM/DD+ +HH:MM:SS,FFF+ +LOG LEVEL+ +LOGGER NAME+ : ?\[LOG MESSAGE\]
\[EXTRA DATA KEY\] = '\[EXTRA DATA VALUE\]'
\[JAVA EXCEPTION\]{panel}


PetalsExtendedFormatter is used to log message content (payload XML of SOAP or JBI Message), attachments name and properties.

The pattern of PetalsExtendedFormatter inherit from the pattern of PetalsSimpleFormatter.


Example of logging output with PetalsExtendedFormatter:
{panel:borderStyle=solid}
2010/06/03 10:22:19,507 MONIT \[Petals.Container.Components.petals-bc-soap\] : This is a test message
invokedServiceName = 'ftpService'
source = '<test>test messsage</test>'
java.lang.RuntimeException: My error
{panel}

{builder-infopanel:The performance of Petals ESB is reduced when the PetalsExtendendFormatter is activate.}
{column}