java - log4j doesn't see log4j.properties file -


i'm trying configure logging in app log4j.properties put /resources folder has following content:

#log level log4j.rootlogger=error, file log4j  #  log4j.appender.file=org.apache.log4j.rollingfileappender # log4j.appender.file.file=d:\agent\temp\panel log.log # log4j.appender.file.maxfilesize=1mb # 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     

and on app start see following in console:

error statuslogger no log4j2 configuration file found. using default configuration: logging errors console. 

what mean , how fix it?

i had same problem, using tomcat 7. solved problem adding conf path /bin/setenv.sh (if on linux, create file if not exist) this:

export java_opts="$java_opts -dconfig.location=file -dlog4j.configuration=file:///opt/apache-tomcat-7.0.61/lib/log4j.properties" 

if on windows edit or create setenv.bat , write (not sure path format):

set java_opts=%java_opts%-dconfig.location=file -dlog4j.configuration=file://c:/opt/apache-tomcat-7.0.61/lib/log4j.properties 

forgot say: affect apps on server


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -