Log4J creates log file but does not write to it

前端 未结 3 1215
执笔经年
执笔经年 2021-01-02 07:50

I\'m trying to configure log4j to log messages to a file. Right now, the file does get created with the name I provide, but the logs are not written to the file. My code:

3条回答
  •  抹茶落季
    2021-01-02 08:38

    I have the same problem, and i solved it. When I changed level form INFO to DEBUG in properties file - line:

    log4j.rootLogger=DEBUG, file, stdout
    

    and than I wrote in script:

    logger.debug("Hello world");

    everything was saved in file.

提交回复
热议问题