I my project .log4j.properties in classpath but when i use mvn
assembly:assembly a *.tar.gz and then tar xvf x.tar.gz
java -cp lib/*:. Test.main
the log output to console ,not output to logj.properites assignation log
file .
➜ git:(master) ✗ ls -al lib/*log*
-rw-r--r-- 1 fuyou staff 60686 8 12 16:47 lib/commons-logging-1.1.1.jar
-rw-r--r-- 1 fuyou staff 367444 8 1 08:47 lib/log4j-1.2.14.jar
-rw-r--r-- 1 fuyou staff 20573 12 5 10:10 lib/logging-1.0.jar
-rw-r--r-- 1 fuyou staff 10792 8 1 08:47 lib/logstat-client-1.0.2.jar
-rw-r--r-- 1 fuyou staff 23786 8 1 08:47 lib/logstat-common-1.0.1.jar
-rw-r--r-- 1 fuyou staff 8869 9 4 15:28 lib/slf4j-log4j12-1.7.5.jar
➜ git:(master) ✗ ls -al lib/*slf*
-rw-r--r-- 1 fuyou staff 26084 8 12 08:40 lib/slf4j-api-1.7.5.jar
-rw-r--r-- 1 fuyou staff 8869 9 4 15:28 lib/slf4j-log4j12-1.7.5.jar
➜ git:(master) ✗ ls -al lib/*jcl-over-slf4j*
zsh: no matches found: lib/*jcl-over-slf4j*
➜ git:(master) ✗ ls -al lib
log4j.properties content
log4j.rootLogger=info, root
log4j.appender.root=org.apache.log4j.DailyRollingFileAppender
log4j.appender.root.DatePattern='.'yyyy-MM-dd
log4j.appender.root.File=logs/test.log
log4j.appender.root.layout=org.apache.log4j.PatternLayout
log4j.appender.root.layout.ConversionPattern=%d %-5p %c{2} %m%n
log4j.appender.root.Append=true
I also ask the question in
stackoverlow<http://stackoverflow.com/questions/20579123/log-cant-write-to-logfile-but-write-to-console>
--
=============================================
fuyou001
Best Regards
_______________________________________________
slf4j-user mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/slf4j-user