[ 
https://issues.apache.org/jira/browse/LOG4PHP-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703698#action_12703698
 ] 

Knut Urdalen commented on LOG4PHP-26:
-------------------------------------

We have raised this discussion as part of another thread before without 
deciding whether or not we want to add file locking to file appenders.

log4j does not have this and I have never seen corrupt log messages because of 
such race condition, however it sounds reasonable to add file locking for file 
appenders.

The main issue is what should an appender do if the file is locked by another 
process? Should it skip logging or should it wait for unlock?

I guess file locking also have a very tiny performance decrease because it need 
to do another system call.



> Add file locking to file appenders
> ----------------------------------
>
>                 Key: LOG4PHP-26
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-26
>             Project: Log4php
>          Issue Type: New Feature
>          Components: Code
>            Reporter: Knut Urdalen
>            Assignee: Knut Urdalen
>             Fix For: 2.0
>
>
> We should add file locking to all file appenders in order to prevent two or 
> more processes accessing the same file at once which may lead to corrupt log 
> files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to