#
#  Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) All Rights Reserved.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#

##
# This is the log4j configuration file used by WSO2 ESB
# =====================================================
#
# IMPORTANT : Please do not remove or change the names of any of the Appenders defined here.
# The layout pattern & log file can be changed using the WSO2 ESB Management Console, and those
# settings will override the settings in this file.
##

##
# WSO2 ESB is now able to create per-service trace logs at runtime. Thus while a message
# is being processed through a Proxy service or the Synapse service (i.e. message mediation through
# the 'main' sequence), tracing may be turned 'on' at any Proxy, Sequence or Mediator level. This
# trace state 'flows' with the message - i.e from a trace enabled sequence to another sequence etc.
# and applies to all mediators within a trace enabled sequence etc. unless another sequence or
# mediator does not override and specify a different trace setting.
##

# the root category is ERROR (applies for all 3rd party JARs etc) and will be logged to the
# LOG_APPENDER and the CONSOLE_APPENDER

log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, ERROR_LOGFILE

log4j.category.org.apache.synapse=INFO
log4j.category.org.apache.synapse.transport=INFO
log4j.category.org.apache.axis2=INFO
log4j.category.org.apache.axis2.transport=INFO
log4j.logger.com.atomikos=INFO,ATOMIKOS
log4j.logger.org.quartz=WARN
log4j.logger.org.wso2=INFO
log4j.logger.org.wso2.carbon=INFO

log4j.logger.org.apache.catalina=WARN
log4j.logger.org.apache.synapse.endpoints.EndpointContext=ERROR
log4j.logger.org.apache.coyote=WARN
log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL

# uncomment the following logs to see HTTP headers and messages
# nhttp case
#log4j.logger.org.apache.synapse.transport.nhttp.headers=DEBUG
#log4j.logger.org.apache.synapse.transport.nhttp.wire=DEBUG
# passthru case
#log4j.logger.org.apache.synapse.transport.passthru.headers=DEBUG
#log4j.logger.org.apache.synapse.transport.passthru.wire=DEBUG

#nhttp accesslogs
#log4j.logger.org.apache.synapse.transport.nhttp.access=INFO

#passthru access logs
log4j.logger.org.apache.synapse.transport.passthru.access=INFO

# qpid related logs for the message broker
log4j.logger.qpid=FATAL
log4j.logger.org.apache.qpid=FATAL

# The console appender is used to display general information at console
log4j.appender.CARBON_CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CARBON_CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CARBON_CONSOLE.layout.ConversionPattern=[%d{ISO8601}] %5p - %c{1} %m%n

# Configure the service logger at INFO level. Writes only run-time/mediation-time audit messages
log4j.category.SERVICE_LOGGER=INFO, SERVICE_APPENDER
log4j.additivity.SERVICE_LOGGER=false
log4j.appender.SERVICE_APPENDER=org.apache.log4j.RollingFileAppender
log4j.appender.SERVICE_APPENDER.File=repository/logs/${instance.log}/wso2-elb${instance.log}.log
log4j.appender.SERVICE_APPENDER.MaxFileSize=1000KB
log4j.appender.SERVICE_APPENDER.MaxBackupIndex=10
log4j.appender.SERVICE_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.SERVICE_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n

# The trace logger dumps enough information @INFO level, but maybe pushed upto TRACE.
# Writes only run-time/mediation time tracing/debug messages for messages passing through trace
# enabled sequences, mediators and services. Enabling tracing on these has a performance impact
log4j.category.TRACE_LOGGER=INFO, TRACE_APPENDER
log4j.additivity.TRACE_LOGGER=false
log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TRACE_APPENDER.File=repository/logs/${instance.log}/wso2-elb-trace${instance.log}.log
log4j.appender.TRACE_APPENDER.Append=true
log4j.appender.TRACE_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n

# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout.
log4j.appender.CARBON_LOGFILE=org.apache.log4j.DailyRollingFileAppender
# Log file will be overridden by the configuration setting in the DB
# This path should be relative to WSO2 Carbon Home
log4j.appender.CARBON_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log
log4j.appender.CARBON_LOGFILE.Append=true
log4j.appender.CARBON_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
# ConversionPattern will be overridden by the configuration setting in the DB
log4j.appender.CARBON_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
log4j.appender.CARBON_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
log4j.appender.CARBON_LOGFILE.threshold=DEBUG

# The standard error log where all the warnings, errors and fatal errors will be logged
log4j.appender.ERROR_LOGFILE=org.apache.log4j.FileAppender
log4j.appender.ERROR_LOGFILE.File=repository/logs/${instance.log}/wso2-elb-errors.log
log4j.appender.ERROR_LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ERROR_LOGFILE.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
log4j.appender.ERROR_LOGFILE.threshold=WARN

log4j.logger.org.apache.directory.shared.ldap=WARN, CARBON_CONSOLE
log4j.logger.org.apache.directory.server.ldap.handlers=WARN, CARBON_CONSOLE
log4j.logger.org.apache.directory.shared.ldap.entry.DefaultServerAttribute=FATAL, CARBON_CONSOLE
log4j.logger.org.apache.directory.shared.ldap.ldif.LdifReader=ERROR, CARBON_CONSOLE
log4j.logger.org.apache.directory.server.ldap.LdapProtocolHandler=ERROR, CARBON_CONSOLE

# Appender config to send Atomikos transaction logs to new log file tm.out.
log4j.appender.ATOMIKOS = org.apache.log4j.RollingFileAppender
log4j.appender.ATOMIKOS.File = repository/logs/tm.out
log4j.appender.ATOMIKOS.Append = true
log4j.appender.ATOMIKOS.layout = org.apache.log4j.PatternLayout
log4j.appender.ATOMIKOS.layout.ConversionPattern=%p %t %c - %m%n
log4j.additivity.com.atomikos=false


