private boolean isOverFileLimit ( int addition ) { if ( LogFile . UNLIMITED == getMaximumSize ( ) ) { return false ; } // Note: to do this properly, we need to know if the admin updates the // file externally, i.e. 'cat /dev/null > file' to clear it out. Windows // JDK filechannel.size() was a buffered value (AIX was not), but the // file.length() call on each checked the real value each time. This is // a slight performance hit but it's the only 100% guarentee of being // accurate. long newlen = this . myFile . length ( ) + addition ; return ( newlen > getMaximumSize ( ) || 0 > newlen ) ; }
Query whether the input amount will push the log file over the maximum allowed size .