logback的官网上的可以直接把log4j的properties 文件转换成logback的xml文件
http://logback.qos.ch/translator/Welcome.do
This page allows you to translate a log4j.properties
file into a logback
xml configuration file.
Just paste the content of your log4j
properties file in the text area below and click translate.
log4j.rootLogger=warn,CONSOLE,FILE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Target=System.out log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern= %4p [%t] ( %F : %L ) - %m - [%C] -%l%n log4j.appender.FILE=org.apache.log4j.FileAppender log4j.appender.FILE.File=chatLog.txt log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.ConversionPattern= %4p [%t] ( %F : %L ) - %m - [%C] -%l%n
<?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <Target>System.out</Target> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%4p [%t] ( %F : %L ) - %m - [%C] -%l%n</pattern> </layout> </appender> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> <File>chatLog.txt</File> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%4p [%t] ( %F : %L ) - %m - [%C] -%l%n</pattern> </layout> </appender> <root> <level value="warn"/> <appender-ref ref="CONSOLE"/> <appender-ref ref="FILE"/> </root> </configuration>