How to initialize log4j properly?

前端 未结 24 3056
太阳男子
太阳男子 2020-11-22 06:49

After adding log4j to my application I get the following output every time I execute my application:

log4j:WARN No appenders could be found for logger (slideselec         


        
24条回答
  •  臣服心动
    2020-11-22 07:08

    You can set the location of your log4j.properties from inside your java app by using:

    org.apache.log4j.PropertyConfigurator.configure(file/location/log4j.properties)
    

    More information is available here: https://logging.apache.org/log4j/1.2/manual.html

提交回复
热议问题