Eclipse complains log4j settings
log4j:WARN No appenders could be found for logger (com.spotify.docker.client.DockerConfigReader).
log4j:WARN Please initialize the log4j system properly.
Solution
create a file log4j.properties according to this post
# Root logger option
log4j.rootLogger=INFO, file, stdout
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/Users/ozhang/oss/log4j/eclipse/eclipse.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
Add a line to /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini
-Dlog4j.configuration=file:///Users/ozhang/oss/log4j/log4j.properties
Result:
Eclipse does not complain log4j any more.
Eclipse and OS versions
Eclipse IDE for C/C++ Developers
Version: 2018-12 (4.10.0)
Build id: 20181214-0600
sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G2112
Labels: Eclipse, log4j
0 Comments:
Post a Comment
<< Home