View Source

{section}
{column}

h1. Logging systems

Petals ESB Hazelcast Registry uses the logging system provided by the JDK.

The logger configuration is determined according to the following ordered rules:
# the file defined as value of the property {{petals.registry.overlay.member.logging-cfg-file}} of the local node configuration, ie. {{member.properties}},
# the file '{{logging.properties}}' located in the same path than the local node configuration, ie. {{member.properties}}.

{column}
{column:width=350px}
{panel:title=Table of contents}{toc:outline=true}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list|showAnonymous=true|showCount=true|showLastTime=true}{panel}
{column}
{section}

h1. Petals ESB Hazelcast Registry Logging specificities

h2. Default levels

The default root logger level is INFO. It means that all classes log only SEVERE, WARNING and INFO information.

You can enable logging and specify a specific level for each module. 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}
## root logger level
.level = INFO

## Petals ESB Registry node level
Petals.Registry.Overlay.level = CONFIG

## Hazelcast level
com.hazelcast.level = WARNING
{code}

{anchor:petals_formatter}
h2. Petals formatter

The Petals formatter {{org.ow2.petals.log.formatter.LogDataFormatter}} is used for traces of the Petals ESB Hazelcast Registry node. The format of the logged message is :
{panel:borderStyle=solid}+YYYY/MM/DD+ +HH:MM:SS,FFF+ +GMT+ +LOG LEVEL+ \[+LOGGER NAME+] : +LOG MESSAGE+{panel}

*Example of logging output with the Petals formatter:*
{code}
2015/05/28 16:25:47,762 GMT+0200 INFO [Petals.Registry.Overlay] : Starting Petals Registry Overlay local member...
2015/05/28 16:25:47,856 GMT+0200 WARNING [Petals.Registry.Overlay] : No JMX user set. The default one will be used.
2015/05/28 16:25:47,856 GMT+0200 WARNING [Petals.Registry.Overlay] : No JMX password set. The default one will be used.
2015/05/28 16:25:47,932 GMT+0200 WARNING [com.hazelcast.instance.DefaultAddressPicker] : [LOCAL] [default-sample] [3.5-SNAPSHOT] Could not find a matching address to start with! Picking one of non-loopback addresses.
2015/05/28 16:25:48,450 GMT+0200 INFO [Petals.Registry.Overlay] : JMX server started at : service:jmx:rmi:///jndi/rmi://localhost:7750/jmxRmiConnector
2015/05/28 16:25:48,451 GMT+0200 INFO [Petals.Registry.Overlay] : Petals Registry Overlay local member started
{code}

h2. Using your own log handler

Custom log handlers are supported. See the [project source code of Petals providing log handlers|https://anonymous:anonymous@svn.petalslink.org/svnroot/trunk/product/dev/prod/petals/tools-commons/petals-log] to write your own.

h1. Tuning your logging configuration

h2. Petals ESB Hazelcast Registry node starts automatically on Debian-based system

If your Petals ESB Hazelcast Registry nodes used in production are:
* installed on Debian-based systems through Debian packages,
* and, running in [automatic mode|Starting and stopping Petals ESB Hazelcast Registry installed by Debian packages],

you can disable the log handler 'console' for which all generated traces on the standard output are discarded, and used only a log handler 'file' ({{java.util.logging.FileHandler}}, {{org.ow2.petals.log.handler.PetalsFileHandler}} according to your needs.
{code}
# Configuration of the log handlers
#####################################
#handlers=java.util.logging.ConsoleHandler, org.ow2.petals.log.handler.PetalsFileHandler
handlers=org.ow2.petals.log.handler.PetalsFileHandler
{code}

h2. Petals ESB Hazelcast Registry node starts manually or installed through ZIP archive
If your Petals ESB Hazelcast Registry installation does not satisfy the previous criteria (not running in automatic mode on a Debian-based system), you can improve performance decreasing the level of the log handler 'console':
{code}
# Configuration of the handler ConsoleHandler
##################################################
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=org.ow2.petals.log.formatter.LogDataFormatter
{code}
You can also remove the log handler 'console' but it's disturbing because no more trace will be printed.