import org.apache.log4j.PatternLayout;
import org.apache.log4j.spi.LoggingEvent;
public class Syslog4jPatternlayout extends PatternLayout {
public String format(LoggingEvent event) {
return "";
}
}
如何配置logback.xml
文件以使用此格式化程序?
答案 0 :(得分:1)
我认为您应该使用logback LayoutBase
public class Syslog4jPatternlayout extends LayoutBase<ILoggingEvent> {
public String doLayout(ILoggingEvent event) {
return "";
}
}
在logback.xml中
<appender name="appender1" class="your appender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="com.kp.Syslog4jPatternlayout" />
</encoder>
</appender>