Java FileHandler disable log rotation

后端 未结 3 1671
無奈伤痛
無奈伤痛 2021-01-28 05:59

I am trying to disable log rotation, for file handler using,

FileHandler fh = new FileHandler
    ( \"path\" + \"run.log\", 1000000, 1, false);

相关标签:
3条回答
  • 2021-01-28 06:13
    Handler fileHandler = new FileHandler(FILE_PATH, true);
    
    0 讨论(0)
  • 2021-01-28 06:16

    Try this: FileHandler fh = new FileHandler( "path" + "run.log", 1000000, 1, true);

    0 讨论(0)
  • 2021-01-28 06:34

    Try 0 as the limit instead of 1000000.

    0 讨论(0)
提交回复
热议问题