Saturday, May 23, 2015

WSO2 ESB - Logging VFS Transport Logs to a Different Log File

If you enable DEBUG logs for VFS transport, it might poison the default wso2carbon.log file. Instead, you can do the following configurations to write VFS transport logs to a different log file, while these logs won't be written to default wso2carbon.log

  1. Add the following configurations to $ESB_HOME/repository/conf/log4j.properties file
  2. log4j.logger.org.apache.synapse.transport.vfs=DEBUG, CARBON_VFS_LOGFILE
    log4j.additivity.org.apache.synapse.transport.vfs = false
     
    log4j.appender.CARBON_VFS_LOGFILE=org.wso2.carbon.logging.appenders.CarbonDailyRollingFileAppender
    log4j.appender.CARBON_VFS_LOGFILE.File=${carbon.home}/repository/logs/${instance.log}/wso2carbon-vfs${instance.log}.log
    log4j.appender.CARBON_VFS_LOGFILE.Append=true
    log4j.appender.CARBON_VFS_LOGFILE.layout=org.wso2.carbon.utils.logging.TenantAwarePatternLayout
    log4j.appender.CARBON_VFS_LOGFILE.layout.ConversionPattern=TID: [%T] [%S] [%d] %P%5p {%c} - %x %m {%c}%n
    log4j.appender.CARBON_VFS_LOGFILE.layout.TenantPattern=%U%@%D [%T] [%S]
    log4j.appender.CARBON_VFS_LOGFILE.threshold=DEBUG
    
    
  3. Restart ESB
  4. A new wso2carbon-vfs.log file will be created in $ESB_HOME/repository/logs directory.

No comments:

Post a Comment