zoukankan      html  css  js  c++  java
  • freemarker log4j警告

    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.

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/D:/apache-maven-3.5.3/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/D:/apache-maven-3.5.3/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.0/log4j-slf4j-impl-2.11.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
    log4j:WARN No appenders could be found for logger (org.apache.commons.configuration.PropertiesConfiguration).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

    log4j和log4j2并存的原因。

  • 相关阅读:
    刷题向》关于一道比较优秀的递推型DP(openjudge9275)(EASY+)
    刷题向》一道简单的思路题BZOJ1800(EASY+)
    算法描述》关于二分的两三事
    值得一做》关于一道暴搜BZOJ1024(EASY+)
    写一个C语言的链表记录一下
    qt 创建第一个工程
    windows好用的便签
    .pro文件部分命令详解
    QT 子文件的建立(pri)
    QTAction Editor的简单使用(简洁明了)
  • 原文地址:https://www.cnblogs.com/zhjh256/p/12128576.html
Copyright © 2011-2022 走看看