http://bugzilla.slf4j.org/show_bug.cgi?id=326
Priority: P5 Bug ID: 326 Assignee: slf4j-dev@qos.ch Summary: Get wrong %class content in wrapper class Severity: enhancement Classification: Unclassified OS: Windows NT Reporter: monkeyk1...@gmail.com Hardware: PC Status: NEW Version: 1.7.x Component: jul-to-slf4j Product: SLF4J I define a Java Object: LogHelper, use it wrapper the logger operations, the main codes as follow: private final Logger logger; protected LogHelper(Class clazz) { this.logger = LoggerFactory.getLogger(clazz); } public void info(String msg) { if (logger.isInfoEnabled()) { logger.info(currentUser() + LOG_DELIMITER + msg); } } ... Then when i want to record log use LogHelper replace Logger, code as follow: private static final LogHelper LOG = LogHelper.create(Activity.class); In the log file can not get the current Class name(Activity class), always get LogHelper class name, the log content look like: 2014-11-28 14:39:15 xxx.infrastructure.log.LogHelper:89 - lisz|Start to generate [2014-10] Attendance-Report... the log appender configuration is: <appender name="SchedulerAppender" class="ch.qos.logback.core.FileAppender"> <file>../logs/xxx_scheduler.log</file> <append>true</append> <encoder> <pattern>%d{yyyy-MM-dd HH:mm:ss} %class:%line - %msg%n</pattern> </encoder> </appender> We expect the %class is Activity class, not LogHelper class, but it is failed. -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ slf4j-dev mailing list slf4j-dev@qos.ch http://mailman.qos.ch/mailman/listinfo/slf4j-dev