Skip to content

Commit

Permalink
fix when file doesn't exist for rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Nov 2, 2023
1 parent 0649b67 commit 20fa800
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion system/logging/util/FileRotator.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ component accessors="true" {
timeout ="#oAppender.getlockTimeout()#"
throwontimeout="true" {
// Should I remove log Files
if ( qArchivedLogs.recordcount >= oAppender.getProperty( "fileMaxArchives" ) ) {
if (
qArchivedLogs.recordcount >= oAppender.getProperty( "fileMaxArchives" )
&&
fileExists( qArchivedLogs.directory[ 1 ] & "/" & qArchivedLogs.name[ 1 ] )
) {
// Remove the oldest archive
fileDelete( qArchivedLogs.directory[ 1 ] & "/" & qArchivedLogs.name[ 1 ] );
}
Expand Down

0 comments on commit 20fa800

Please sign in to comment.