If doing a negative offset to grab the end of a file and the file is shorter than the offset, then file_get_contents( ) will return false.
If you want it to just return what is available when the file is shorter than the negative offset, you could try again.
For example...
$contents = file_get_contents( $log_file, false, null, -4096 ); // Get last 4KB
if ( false === $contents ) {
// Maybe error, or maybe file less than 4KB in size.
$contents = file_get_contents( $log_file, false, null );
if ( false === $contents ) {
// Handle real error.
}
}