diff --git a/webif/lib/auto/util.jim b/webif/lib/auto/util.jim index 82754d6..30681d2 100644 --- a/webif/lib/auto/util.jim +++ b/webif/lib/auto/util.jim @@ -5,12 +5,13 @@ set ::auto::logprefix "" set ::auto::loglevel 1 proc ::auto::loginit {} { - + variable settings + set logsize [$settings logsize] # Rotate log file if large enough. if {[file exists $::auto::logfile] && - [file size $::auto::logfile] > 2097152} { - file copy -force $::auto::logfile "/mod/tmp/auto_old.log" - file delete $::auto::logfile + [file size $::auto::logfile] > $logsize} { + set tstamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] + file rename -force $::auto::logfile "/mod/tmp/auto.$tstamp.log" } # Open log file