Where to place log4j.xml

前端 未结 6 747
滥情空心
滥情空心 2020-11-30 02:37

How can we specify were log4j has to look at when trying to find its xml configuration file ?

It seems that by default, log4j looks into the root of a class folder,

6条回答
  •  情书的邮戳
    2020-11-30 03:09

    I don't have any error

    So log4j is finding your configuration, otherwise you would get:

    log4j:WARN No appenders could be found for logger ().
    log4j:WARN Please initialize the log4j system properly.

    Also:

    The log are just printed out on the console

    So that means that you probably need to define a file appender, like FileAppender or RollingFileAppender. The "Configuration" section on the short intro has a few examples.

提交回复
热议问题