sub Log::Log4perl::Appender::File::log { my($self, %params) = @_; my $fh = $self->{fh}; flock( $fh => LOCK_EX ); print $fh $params{message}; flock( $fh => LOCK_UN ); if ($self->{autoflush}) { my $oldfh = select $self->{fh}; $| = 1; select $oldfh; } }