码迷,mamicode.com
首页 > 其他好文 > 详细

freemarker log4j警告

时间:2020-01-01 13:38:44      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:perl   nbsp   就会   apach   tput   logging   inf   from   not   

log4j:WARN No appenders could be found for logger (freemarker.cache).

log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

因为freemarker只依赖了log4j,不支持log4j2,所以必须在classpath中加上log4j.properties,否则就会出现上述警告。

# freemarker专用 Global logging configuration 这个配置是调试用的配置,生产环境要改成INFO或更高级别
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern= %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n

 

加上后如下:

2020-01-01 12:03:08 [ http-nio-8080-exec-1:0 ] - [ DEBUG ] Couldn‘t find template in cache for "system/login.html"("zh_CN", UTF-8, parsed); will try to load it.
2020-01-01 12:03:08 [ http-nio-8080-exec-1:2 ] - [ DEBUG ] TemplateLoader.findTemplateSource("system/login_zh_CN.html"): Not found
2020-01-01 12:03:08 [ http-nio-8080-exec-1:18 ] - [ DEBUG ] TemplateLoader.findTemplateSource("system/login_zh.html"): Not found
2020-01-01 12:03:08 [ http-nio-8080-exec-1:19 ] - [ DEBUG ] TemplateLoader.findTemplateSource("system/login.html"): Found
2020-01-01 12:03:08 [ http-nio-8080-exec-1:19 ] - [ DEBUG ] Loading template for "system/login.html"("zh_CN", UTF-8, parsed) from "class path resource [templates/system/login.html]"
2020-01-01 12:03:09 [ http-nio-8080-exec-1:142 ] - [ DEBUG ] "system/login.html"("zh_CN", UTF-8, parsed) cached copy not yet stale; using cached.

 

freemarker log4j警告

标签:perl   nbsp   就会   apach   tput   logging   inf   from   not   

原文地址:https://www.cnblogs.com/zhjh256/p/12128576.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!