开发者

Log4j on weblogic10 only logs to console

开发者 https://www.devze.com 2023-01-27 13:51 出处:网络
I\'m trying to print my log messages to a file. At this point, it only logs to the console which is not ideal for future support.

I'm trying to print my log messages to a file. At this point, it only logs to the console which is not ideal for future support.

My log4j.properties file looks like this:

log4j.rootCategory=DEBUG, stdout, logfile

log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender

log4j.appender.logfile.File:/apps/wlserver10/bpdomain/servers/HRServer/logs/HRServer.log log4j.appender.logfile.MaxFileSize=4MB log4j.appender.logfile.MaxBackupIndex=10 log4j.appender.logfile.Append=true log4j.append开发者_如何学Cer.logfile.layout=org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n

This works fine on my local weblogic instance, but when I try to deploy it to the server it doesn't write the log file.

Can anyone please help me find why? Thanks in advance Yols


Is it the missing = after File instead of : ?

log4j.appender.logfile.File:/apps/wlserver10/bpdomain/servers/HRServer/logs/HRServer.log


Did you miss '=' in this part of your configuration:

log4j.appender.logfile.File**:/**apps/wlserver10/bpdomain/servers/HRServer/logs/HRServer.log

Regards

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号