vtortola
vtortola

Reputation: 35945

FileLogTraceListener remove oldest logs when there is no space

Is there a way to instruct FileLogTraceListener to delete old log files when it has no enough space on disk?

Cheers.

Upvotes: 2

Views: 794

Answers (1)

Skomski
Skomski

Reputation: 4870

You should set the ReserveDiskSpace Property to your preferred size and the DiskSpaceExhaustedBehavior Property to ThrowException.

Then add Try...Catch blocks around all code that writes to the log and delete logs when you catch that exception.

Upvotes: 2

Related Questions