logback_broker.xml
${user.home}/logs/rocketmqlogs/broker_default.log true ${user.home}/logs/rocketmqlogs/otherdays/broker_default.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/broker.log true ${user.home}/logs/rocketmqlogs/otherdays/broker.%i.log.gz 1 20 128MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/protection.log true ${user.home}/logs/rocketmqlogs/otherdays/protection.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/watermark.log true ${user.home}/logs/rocketmqlogs/otherdays/watermark.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/store.log true ${user.home}/logs/rocketmqlogs/otherdays/store.%i.log.gz 1 10 128MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/remoting.log true ${user.home}/logs/rocketmqlogs/otherdays/remoting.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/storeerror.log true ${user.home}/logs/rocketmqlogs/otherdays/storeerror.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/transaction.log true ${user.home}/logs/rocketmqlogs/otherdays/transaction.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/lock.log true ${user.home}/logs/rocketmqlogs/otherdays/lock.%i.log.gz 1 5 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/filter.log true ${user.home}/logs/rocketmqlogs/otherdays/filter.%i.log.gz 1 10 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p %t - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/stats.log true ${user.home}/logs/rocketmqlogs/otherdays/stats.%i.log.gz 1 5 100MB %d{yyy-MM-dd HH:mm:ss,GMT+8} %p - %m%n UTF-8 ${user.home}/logs/rocketmqlogs/commercial.log true ${user.home}/logs/rocketmqlogs/otherdays/commercial.%i.log.gz 1 10 500MB true %d{yyy-MM-dd HH\:mm\:ss,GMT+8} %p %t - %m%n UTF-8
LoggerName.java
public class LoggerName { public static final String FILTERSRV_LOGGER_NAME = "RocketmqFiltersrv"; public static final String NAMESRV_LOGGER_NAME = "RocketmqNamesrv"; public static final String BROKER_LOGGER_NAME = "RocketmqBroker"; public static final String BROKER_CONSOLE_NAME = "RocketmqConsole"; public static final String CLIENT_LOGGER_NAME = "RocketmqClient"; public static final String TOOLS_LOGGER_NAME = "RocketmqTools"; public static final String COMMON_LOGGER_NAME = "RocketmqCommon"; public static final String STORE_LOGGER_NAME = "RocketmqStore"; public static final String STORE_ERROR_LOGGER_NAME = "RocketmqStoreError"; public static final String TRANSACTION_LOGGER_NAME = "RocketmqTransaction"; public static final String REBALANCE_LOCK_LOGGER_NAME = "RocketmqRebalanceLock"; public static final String ROCKETMQ_STATS_LOGGER_NAME = "RocketmqStats"; public static final String COMMERCIAL_LOGGER_NAME = "RocketmqCommercial"; public static final String FLOW_CONTROL_LOGGER_NAME = "RocketmqFlowControl"; public static final String ROCKETMQ_AUTHORIZE_LOGGER_NAME = "RocketmqAuthorize"; public static final String DUPLICATION_LOGGER_NAME = "RocketmqDuplication"; public static final String PROTECTION_LOGGER_NAME = "RocketmqProtection"; public static final String WATER_MARK_LOGGER_NAME = "RocketmqWaterMark"; public static final String FILTER_LOGGER_NAME = "RocketmqFilter";}
代码中的使用
private static final Logger log = LoggerFactory.getLogger(LoggerName.FILTERSRV_LOGGER_NAME);