0

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

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

What i want is one log, created for each run i do not want rotation or backing up of the old file, but using this initialization i get run.log run.log.1 run.log.2 for each run.

Also

        logger.setUseParentHandlers(false);

is set to false.

Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241

3 Answers3

1

Try 0 as the limit instead of 1000000.

Bombe
  • 81,643
  • 20
  • 123
  • 127
0

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

stealthyninja
  • 10,343
  • 11
  • 51
  • 59
S.Yavari
  • 876
  • 8
  • 25
0
Handler fileHandler = new FileHandler(FILE_PATH, true);
sparkyspider
  • 13,195
  • 10
  • 89
  • 133