karaf_home/etc/org.ops4j.pax.logging.cfg
### direct log messages to stdout ### log4j.appender.consoleout=org.apache.log4j.ConsoleAppender log4j.appender.consoleout.layout=org.apache.log4j.PatternLayout log4j.appender.consoleout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c:%L - %m%n ### direct messages to file myfile.log ### log4j.appender.myfile=org.apache.log4j.DailyRollingFileAppender log4j.appender.myfile.File=myfile.log log4j.appender.myfile.DatePattern='.'yyyy-MM-dd log4j.appender.myfile.layout=org.apache.log4j.PatternLayout log4j.appender.myfile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c:%L - %m%n log4j.logger.org.my.shell=info, consoleout,myfile
karaf加入自定义log4j的配置,布布扣,bubuko.com
原文地址:http://blog.csdn.net/wobendiankun/article/details/37889707