概述
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>
最后
以上就是执着心锁为你收集整理的log4j的properties 文件转换成logback的xml文件的全部内容,希望文章能够帮你解决log4j的properties 文件转换成logback的xml文件所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复