How to disable log4j logging from Java code

前端 未结 8 1651
难免孤独
难免孤独 2021-02-07 13:58

I use a legacy library that writes logs using log4j. My default log4j.properties file directs the log to the console, but in some specific functions of my main program, I would

8条回答
  •  难免孤独
    2021-02-07 14:34

    You could try TO disable it changing your log4j.properties:

    log4j.rootLogger=off, stdout
    #log4j.logger.ac.biu.nlp.nlp.engineml=info, logfile
    #log4j.logger.org.BIU.utils.logging.ExperimentLogger=warn
    
    ...
    

    Ref: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html#OFF

提交回复
热议问题