How to enable log4j for Usergrid

I deployed the usergrid to tomcat, I can see that it is using slf4j binds for log4j, I tried to put the log4j.properties in / var / lib / tomcat 7 / webapps / ROOT / WEB-INF / classes $ but still can't see the log file created? can anyone help?

Weatherdrid is here, github.com/apache/incubator-usergrid

I built it myself and put ROOT.war in tomcat / var / lib / tomcat7 / webapps / while trying to enable logs in usergrid I see a lot of log.info in usergrid code then I put log4j.properties in / var / lib / tomcat7 / webapps / ROOT / WEB-INF / classes but no log file is generated

# Root logger option
log4j.rootLogger=INFO, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender

#Redirect to Tomcat logs folder
log4j.appender.file.File=${catalina.home}/logs/logging.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

      

+3


source to share


1 answer


I was able to set up Log4j logging on the Usergrid by adding the following Tomcat CATALINA_OPTS environment variable:

-Dlog4j.configuration=file:/${path}/log4j.properties

      



Where $ {path} is the path to your Log4j properties file.

0


source







All Articles