Logging in PETALS

Logging systems

Petals ESB uses two distinct logging systems. Most of the container apart from the registry uses the logger provided by the JDK, while the registry uses Apache log4j.

The Petals ESB logger configuration is splitted into two files, one for each logging system:

  • the JDK Logging system is configured according to the following ordered rules:
    1. the file defined as value of the Java system property petals.container.log.config.file to set on the Java command line,
    2. the file defined as value of the property petals.container.log.config.file of the local container configuration, ie. server.properties,
    3. the file 'loggers.properties' located in the same path than the local container configuration, ie. server.properties.
  • log4j.properties: is configured through the file 'log4j.properties' located in the same path than the local container configuration, ie. server.properties.
An issue JIRA already exists to merge both logging systems: PETALSESBCONT-227

Each property value of the JDK logging system configuration file can contain reference to other properties using a placeholder as:

org.ow2.petals.log.handler.PetalsFileHandler.basedir=$\{petals.log.dir}

Available properties to use as placeholder are:

  • the system properties including all properties defined on the java command line using the flag '-D',
  • the properties of the container configuration file, ie. server.properties.
Contributors
No contributors found for: authors on selected page(s)

Petals Logging specificities

Level 'MONIT'

Petals defines a new specific level: MONIT. This level is used to trace the exchange activities and permit to deduce the process taken into account by an initial request.

The level MONIT is inserted between levels CONFIG and FINE:

  • SEVERE (highest value)
  • WARNING
  • INFO
  • CONFIG
  • MONIT
  • FINE
  • FINER
  • FINEST (lowest value)

To get a detailed view of Petals logging mechanisms, please refer to the page [Monitoring Petals ESB Flows with its logs].

Default levels

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

The default Petals root logger level is INFO. That's why all Petals components will log only SEVERE, WARNING and INFO information.

The default components level is MONIT.

You can enable logging and specify a specific level for each module (container, component, cdk...). 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.

##Petals level
Petals.level = FINEST

#Handler Configuration
java.util.logging.ConsoleHandler.level = FINEST

Example of configuration to debug (Level FINEST) petals-bc-soap component:

##Petals level
Petals.level = INFO #Log level for all petals services
Petals.Container.Components.level = MONIT #log level for all components
Petals.Container.Components.petals-bc-soap.level = FINEST #Log level for petals-bc-soap component

#Handler Configuration
java.util.logging.ConsoleHandler.level = FINEST

Petals formatters

PetalsFormatter uses the following pattern:

Petals Node Name YYYY/MM/DD HH:MM:SS,FFF LOG LEVEL LOGGER NAME : ?[LOG MESSAGE]
[EXTRA DATA KEY] = '[EXTRA DATA VALUE]'
[JAVA EXCEPTION]

Example of logging output with PetalsFormatter:

node1 2011/08/25 15:44:44,426 GMT+0200 MONIT [Petals.Container.Components.petals-bc-soap] : traceCode = 'consumeFlowStepBegin',flowInstanceId = '62cdea40-cf20-11e0-bdfa-000c29523cc7',flowStepId = '62ce3860-cf20-11e0-bdfa-000c29523cc7',flowInterfaceName = '{http://usecase1/bpel-P12/}interfaceName1',flowServiceName = '{http://usecase1/bpel-P12/}serviceName1',flowEndpointName = 'endpointName1',flowOperationName = '{http://usecase1/bpel-P12/}process',client = '192.168.1.157',requestedURL = 'http://192.168.1.196:8084/petals/services/soap-C1'

Default behavior
One or both previous formatters are always used during execution, unless default handler formatters in ../conf/logger.properties are changed

If following formatter is applied for both handlers:

org.ow2.petals.kernel.logging.PetalsFileHandler.formatter = org.ow2.petals.kernel.logging.PetalsFormatter
java.util.logging.ConsoleHandler.formatter = org.ow2.petals.commons.logger.PetalsFormatter

All logs are processed by the PetalsFormatter whether we are in FINEST, SEVERE, CONFIG ... MONIT, but

the both previous log traces are written if the level MONIT is precised.

Splitting log files

Petals ESB allow to split its log records into a log files hierarchy. This is done thanks to the PetalsFileHandler which can redirect log records to separate according to Petals ESB runtime properties.

In addition to standard Handler properties (level, formatter, etc..), PetalsFileHandler can be configured through the following extra properties:

  • basedir: base directory where log files will be stored. Default value (if no property set) is user home directory.

In this base directory, you'll find two things:

  • a petals.log file which contains all petals container logs
  • a flow-monitoring sub-directory which contains flowInstanceId sub-directories (one per flow instanciation).

Logged informations

Following informations are commons to both formatters:

  • Petals Node Name
  • Timestamp
  • Logger level
  • Logger component name
  • Log message

We can found more informations about previous concepts in glossary Glossary

 
 

Environment variable
Take in account if the following variable is define or not:

-Djava.util.logging.config.file=$PETALS_HOME/conf/loggers.properties"

Because, if the previous argument on your Petals process is setted to another logging file, the loggers.properties under /conf will not be take in account.

This setting can create a real problem, you do not necessarily understand where it comes directly

Appendix

Default loggers.properties

The default loggers.properties is :

# PETALS: PETALS Services Platform
# Copyright (C) 2005  EBM WebSourcing
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
# USA.
#
# Initial developer(s): EBM WebSourcing

handlers=java.util.logging.ConsoleHandler, org.ow2.petals.kernel.logging.PetalsFileHandler

java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = org.ow2.petals.kernel.logging.PetalsFormatter

org.ow2.petals.kernel.logging.PetalsFileHandler.level = MONIT
org.ow2.petals.kernel.logging.PetalsFileHandler.basedir = ${petals.home}/logs/
org.ow2.petals.kernel.logging.PetalsFileHandler.formatter = org.ow2.petals.kernel.logging.PetalsFormatter

##Root level
.level = FINEST

##Petals level
Petals.level = FINEST

Petals.Container.Components.level = MONIT

#Petals.PetalsAdminService.level = FINEST
#Petals.AutoLoaderService.level = FINEST
#Petals.ConfigurationService.level = FINEST

#Petals.Container.level = FINEST
#Petals.Container.ContainerService.level = FINEST

#Petals.Container.Lifecycle.level = FINEST
#Petals.Container.Lifecycle.ComponentLifeCycle.level = FINEST
#Petals.Container.Lifecycle.Installer.level = FINEST
#Petals.Container.Lifecycle.ServiceAssemblyLifeCycle.level = FINEST
#Petals.Container.Lifecycle.SharedLibraryLifeCycle.level = FINEST

#Petals.Communication.level = FINEST
#Petals.Communication.TopologyService.level = FINEST
#Petals.Communication.JNDIAgentService.level = FINEST
#Petals.Communication.JNDIService.level = FINEST
#Petals.Communication.JMXService.level = FINEST
#Petals.Communication.RMIConnector.level = FINEST
#Petals.Communication.RemoteCheckerClient.level = FINEST

#Petals.Tools.WebServiceManager.level = FINEST

#Petals.System.level = FINEST
#Petals.System.PersistenceService.level = FINEST
#Petals.System.LoaderManagerService.level = FINEST
#Petals.System.SystemStateService.level = FINEST
#Petals.System.RepositoryService.level = FINEST
#Petals.System.Artifact.FractalArtifactRepositoryService.level = FINEST

#Petals.JBI-Management.level = FINEST
#Petals.JBI-Management.AdminService.level = FINEST
#Petals.JBI-Management.SystemRecoveryService.level = FINEST
#Petals.JBI-Management.InstallationService.level = FINEST
#Petals.JBI-Management.ComponentInstallationService.level = FINEST
#Petals.JBI-Management.DeploymentService.level = FINEST
#Petals.JBI-Management.AtomicDeploymentService.level = FINEST
#Petals.JBI-Management.TransactionManager.level = FINEST

#Petals.JBI-Messaging.level = FINEST
#Petals.JBI-Messaging.RouterMonitorService.level = FINEST
#Petals.JBI-Messaging.RouterService.level = FINEST
#Petals.JBI-Messaging.FlowControllerModule.level = FINEST
#Petals.JBI-Messaging.FlowFilterModule.level = FINEST
#Petals.JBI-Messaging.PriorityOrdererModule.level = FINEST
#Petals.JBI-Messaging.TransportResolverModule.level = FINEST
#Petals.JBI-Messaging.AuthorizationModule.level = FINEST
#Petals.JBI-Messaging.EndpointResolverModule.level = FINEST
#Petals.JBI-Messaging.JAASAuthenticationModule.level = FINEST
#Petals.JBI-Messaging.PriorityOrdererModule.level = FINEST
#Petals.JBI-Messaging.EndpointRegistry.level = FINEST
#Petals.JBI-Messaging.JMXExchangeCheckerClient.level = FINEST

#Petals.JBI-Component.ComponentContext.level = FINEST

#Petals.Transporter.level = FINEST
#Petals.Transporter.LocalTransporter.level = FINEST
#Petals.Transporter.NioTransporter.level = FINEST
#Petals.Transporter.NioTransportProtocol.NioSelectorAgent.level = FINEST
#Petals.Transporter.NioTransportProtocol.NioServerAgent.level = FINEST
#Petals.Transporter.NioTransportProtocol.NioClientObjectPool.level = FINEST

#Petals.WS.level = FINEST
#Petals.WS.ArtifactRepositoryService.level = FINEST
#Petals.WS.DeploymentService.level = FINEST
#Petals.WS.DragonConnectionService.level = FINEST
#Petals.WS.EndpointService.level = FINEST
#Petals.WS.InformationService.level = FINEST
#Petals.WS.InstallationService.level = FINEST
#Petals.WS.JBIArtefactsService.level = FINEST
#Petals.WS.RuntimeService.level = FINEST
#Petals.WS.ServiceAssemblyStateService.level = FINEST
#Petals.WS.TopologyService.level = FINEST

loggers.properties 

Default log4j.properties

The default log4j.properties is :

# Set the options for the Console appender.
# Console's layout is a PatternLayout, using the conversion pattern
# %d: current date in ISO8601 format
# %p: priority of the logging event
# %c: category name
# %m: the message
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d %-5p %c{3} %m\n

# Root logger set to INFO using the Console appender defined above.
log4j.rootLogger=fatal,Console

######################
# Logger definitions #
######################

# CXF logger #
#log4j.logger.org.apache.cxf=fatal,Console
#log4j.additivity.org.apache.cxf=true

# Hibernate logger #
log4j.logger.org.hibernate=fatal,Console
log4j.additivity.org.hibernate=true

# Registry logger #
log4j.logger.org.ow2.petals.registry=fatal,Console
log4j.additivity.org.ow2.petals.registry=true

log4j.properties 

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.