Logging in Petals

Version 1 by Christophe DENEUX
on Aug 04, 2015 10:31.

compared with
Current by Christophe DENEUX
on Mar 01, 2017 11:02.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
{note}An issue JIRA already exists to dump the whole content of messages, including properties and attachments: {jira:PETALSESBCONT-228}{note}

h2. Disabling log file hierarchy

By default, the Petals ESB configuration uses the log handler {{org.ow2.petals.log.handler.PetalsFileHandler}} that manages a log files hierarchy. If you don't use log trace MONIT, you have always this file hierarchy that could contains warning or severe errors. In some case, you will prefer to have only one global log file instead of this hierarchy to avoid a potential huge number of files. Simply replace the log handler {{org.ow2.petals.log.handler.PetalsFileHandler}} by, for example, {{java.util.logging.FileHandler}}:
{code}
# Configuration of the log handlers
#####################################
handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler

# Configuration of the handler FileHandler
##################################################
java.util.logging.FileHandler.level=CONFIG
java.util.logging.FileHandler.pattern=/var/log/petals/petals%u-%g.log
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=10
java.util.logging.FileHandler.formatter=org.ow2.petals.log.formatter.LogDataFormatter
{code}

{tip}
To be able to print correctly MONIT traces, you must use the formatter {{org.ow2.petals.log.formatter.LogDataFormatter}}
{tip}

h2. Performances