How to initialize log4j properly?

前端 未结 24 3329
太阳男子
太阳男子 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 06:56

    Maven solution:

    I came across all the same issues as above, and for a maven solution I used 2 dependencies. This configuration is only meant for quick testing if you want a simple project to be using a logger, with a standard configuration. I can imagine you want to make a configuration file later on if you need more information and or finetune your own logging levels.

        
            1.7.28
        
    
            
                org.slf4j
                slf4j-api
                ${slf4jVersion}
            
            
                org.slf4j
                slf4j-jdk14
                ${slf4jVersion}
            
    

提交回复
热议问题