Usergrid在这里,github.com / apache / plasticubator-usergrid
我自己构建它并将ROOT.war放在tomcat / var / lib / tomcat7 / webapps /中,尝试在usergrid中启用日志,我在usergrid的代码中看到很多log.info,然后我把log4j.properties在/ var / lib / tomcat7 / webapps / ROOT / WEB-INF / classes中,但未创建日志文件
# 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
答案 0 :(得分:0)
我已经能够通过在Tomcat的CATALINA_OPTS环境变量中添加以下内容来配置Usergrid中的Log4j日志记录:
#cmlLogo {
background:url("#resource['images/homepage/'.concat(fUserController.userLanguageCode()).concat('/kml_logo.png')]}") no-repeat !important;
width: 203px;
height:127px;
background-position: right !important;
margin-bottom: -2px;
background-size: auto !important;
}
其中$ {path}是Log4j属性文件的路径。