Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NLog File splitting

I'm using NLog to log to file. Is there a way to configure it to create a new log file when the current one reaches a certain threshold (eg ~50mb)? Can it be done from the configuration file or code?

like image 403
Shawn Mclean Avatar asked Feb 05 '11 23:02

Shawn Mclean


1 Answers

Yes:

fileName="${basedir}/logs/logfile.txt" 
archiveFileName="${basedir}/archives/log.{#####}.txt"
archiveAboveSize="5242880"
archiveNumbering="Sequence"
concurrentWrites="true" <!-- http://nlog-project.org/doc/2.0/sl2/html/P_NLog_Targets_FileTarget_ArchiveAboveSize.htm -->
like image 152
hangy Avatar answered Oct 02 '22 04:10

hangy