#
#  Copyright (c) 2005-2015, 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 AM
# =====================================================
#
# 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 AM Management Console, and those
# settings will override the settings in this file.
##


# 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, CARBON_MEMORY, CARBON_SYS_LOG, ERROR_LOGFILE

log4j.logger.AUDIT_LOG=INFO, AUDIT_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.category.org.apache.synapse.transport.nhttp.util=DEBUG
#log4j.category.org.apache.http.impl.nio.reactor=DEBUG
#log4j.logger.org.wso2.carbon.utils.deployment.ComponentBuilder=DEBUG
#log4j.logger.org.wso2.carbon.utils.deployment.OSGiBundleDeployer=DEBUG
log4j.logger.org.apache.catalina=WARN
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
#log4j.logger.org.apache.synapse.transport.http.headers=DEBUG
#log4j.logger.org.apache.synapse.transport.http.wire=DEBUG

# qpid related logs for the message broker
log4j.logger.qpid=WARN
log4j.logger.org.apache.qpid=WARN
log4j.logger.org.apache.qpid.server.Main=INFO
log4j.logger.qpid.message=WARN
log4j.logger.qpid.message.broker.listening=INFO
log4j.logger.org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher=WARN

# The console appender is used to display general information at console
log4j.appender.CARBON_CONSOLE=org.wso2.carbon.utils.logging.appenders.CarbonConsoleAppender
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=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-service${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, TRACE_MEMORYAPPENDER
log4j.additivity.TRACE_LOGGER=false
log4j.appender.TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-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

# The memory appender for trace logger
log4j.appender.TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender
log4j.appender.TRACE_MEMORYAPPENDER.bufferSize=2000
log4j.appender.TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n

# CARBON_LOGFILE is set to be a DailyRollingFileAppender using a PatternLayout.
log4j.appender.CARBON_LOGFILE=org.wso2.carbon.utils.logging.appenders.CarbonDailyRollingFileAppender
# 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=${carbon.home}/repository/logs/${instance.log}/wso2-apigw-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

# The memory appender for logging
log4j.appender.CARBON_MEMORY=org.wso2.carbon.logging.service.appender.CarbonMemoryAppender
log4j.appender.CARBON_MEMORY.bufferSize=2000
log4j.appender.CARBON_MEMORY.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
# ConversionPattern will be overridden by the configuration setting in the DB
log4j.appender.CARBON_MEMORY.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
log4j.appender.CARBON_MEMORY.layout.TenantPattern=%U%@%D [%T] [%S]
log4j.appender.CARBON_MEMORY.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
log4j.appender.CARBON_MEMORY.threshold=DEBUG

# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT
log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender
log4j.appender.LOGEVENT.url=tcp://localhost:7611
log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%I,%Stacktrace
log4j.appender.LOGEVENT.userName=admin
log4j.appender.LOGEVENT.password=admin
log4j.appender.LOGEVENT.processingLimit=1000
log4j.appender.LOGEVENT.maxTolerableConsecutiveFailure=20


log4j.appender.CARBON_SYS_LOG = org.apache.log4j.net.SyslogAppender
log4j.appender.CARBON_SYS_LOG.layout=org.apache.log4j.PatternLayout
log4j.appender.CARBON_SYS_LOG.layout.ConversionPattern=[%d] %5p - %x %m {%c}%n
log4j.appender.CARBON_SYS_LOG.SyslogHost=localhost
log4j.appender.CARBON_SYS_LOG.Facility=USER
log4j.appender.CARBON_SYS_LOG.threshold=DEBUG

# LOGEVENT is set to be a LogEventAppender using a PatternLayout to send logs to LOGEVENT
log4j.appender.LOGEVENT=org.wso2.carbon.logging.appender.LogEventAppender
log4j.appender.LOGEVENT.url=tcp://localhost:7611
log4j.appender.LOGEVENT.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
log4j.appender.LOGEVENT.columnList=%T,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
log4j.appender.LOGEVENT.userName=admin
log4j.appender.LOGEVENT.password=admin

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

## Trace Logger configuration which will append to a XMPP chatroom or JID ##
#log4j.appender.XMPP_APPENDER=org.wso2.carbon.utils.logging.IMAppender
#log4j.appender.XMPP_APPENDER.host=jabber.org
#log4j.appender.XMPP_APPENDER.username=wso2esb
#log4j.appender.XMPP_APPENDER.password=wso2esb
#log4j.appender.XMPP_APPENDER.recipient=ruwan@jabber.org
#log4j.appender.XMPP_APPENDER.layout=org.apache.log4j.PatternLayout
#log4j.appender.XMPP_APPENDER.layout.ConversionPattern=[%X{host}] [%t] %-5p [%d{HH:mm:ss,SSS}] %C{1} - %m%n

# Appender config to AUDIT_LOGFILE
log4j.appender.AUDIT_LOGFILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.AUDIT_LOGFILE.File=${carbon.home}/repository/logs/audit.log
log4j.appender.AUDIT_LOGFILE.Append=true
log4j.appender.AUDIT_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
log4j.appender.AUDIT_LOGFILE.layout.ConversionPattern=[%d] %P%5p - %x %m %n
log4j.appender.AUDIT_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
log4j.appender.AUDIT_LOGFILE.threshold=INFO
log4j.additivity.AUDIT_LOG=false

# 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

# DAS_AGENT is set to be a Custom Log Appender.
log4j.appender.DAS_AGENT=org.wso2.carbon.analytics.shared.data.agents.log4j.appender.LogEventAppender
# DAS_AGENT uses PatternLayout.
log4j.appender.DAS_AGENT.layout=org.wso2.carbon.analytics.shared.data.agents.log4j.util.TenantAwarePatternLayout
log4j.appender.DAS_AGENT.columnList=%D,%S,%A,%d,%c,%p,%m,%H,%I,%Stacktrace
log4j.appender.DAS_AGENT.userName=admin
log4j.appender.DAS_AGENT.password=admin
log4j.appender.DAS_AGENT.url=tcp://localhost:7612
log4j.appender.DAS_AGENT.maxTolerableConsecutiveFailure=5
log4j.appender.DAS_AGENT.streamDef=loganalyzer:1.0.0
log4j.logger.trace.messages=TRACE,CARBON_TRACE_LOGFILE

# Appender config to CARBON_TRACE_LOGFILE
log4j.appender.CARBON_TRACE_LOGFILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CARBON_TRACE_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-trace-messages${instance.log}.log
log4j.appender.CARBON_TRACE_LOGFILE.Append=true
log4j.appender.CARBON_TRACE_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
log4j.appender.CARBON_TRACE_LOGFILE.layout.ConversionPattern=[%d] %P%5p {%c} - %x %m %n
log4j.appender.CARBON_TRACE_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
log4j.appender.CARBON_TRACE_LOGFILE.threshold=TRACE
log4j.additivity.trace.messages=false


# The event trace logger dumps enough information @INFO level, but maybe pushed upto TRACE.
# Writes only run-time/event processing time tracing/debug messages for event passing through trace
# enabled transport adapters event formatters, builders and processors. Enabling event tracing on these has a performance impact
log4j.category.EVENT_TRACE_LOGGER=INFO, EVENT_TRACE_APPENDER, EVENT_TRACE_MEMORYAPPENDER
log4j.additivity.EVENT_TRACE_LOGGER=false
log4j.appender.EVENT_TRACE_APPENDER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.EVENT_TRACE_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-cep-trace${instance.log}.log
log4j.appender.EVENT_TRACE_APPENDER.Append=true
log4j.appender.EVENT_TRACE_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.EVENT_TRACE_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n
# The memory appender for trace logger
log4j.appender.EVENT_TRACE_MEMORYAPPENDER=org.wso2.carbon.utils.logging.appenders.MemoryAppender
log4j.appender.EVENT_TRACE_MEMORYAPPENDER.bufferSize=2000
log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.EVENT_TRACE_MEMORYAPPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %m%n