[
https://issues.apache.org/jira/browse/LOG4PHP-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499832#comment-16499832
]
Robert Lu commented on LOG4PHP-225:
-----------------------------------
If we {{fopen}} a file with append options, it will make syscall {{open}} with
{{O_APPEND}}.([https://github.com/php/php-src/blob/php-7.0.30/main/streams/plain_wrapper.c#L75-L76]).
and {{fwrite}} will make syscall
{{write}}.([https://github.com/php/php-src/blob/php-7.0.30/main/streams/plain_wrapper.c#L351])
according to
[POSIX|http://pubs.opengroup.org/onlinepubs/7908799/xsh/write.html]:
{quote} If the O_APPEND flag of the file status flags is set, the file offset
will be set to the end of the file prior to each write and no intervening file
modification operation will occur between changing the file offset and the
write operation. {quote}
So, I think {{LoggerAppenderFile}} without flock is safe.
> Implement locking as a configurable parameter on LoggerAppenderFile
> -------------------------------------------------------------------
>
> Key: LOG4PHP-225
> URL: https://issues.apache.org/jira/browse/LOG4PHP-225
> Project: Log4php
> Issue Type: New Feature
> Components: Code
> Affects Versions: 2.3.0
> Reporter: Tim Down
> Priority: Major
> Attachments: 0001-make-locking-configurable.patch
>
>
> Locking a log file using flock is not an option in our production
> environment, so I need to be able to disable locking. There is a TODO in
> LoggerAppenderFile.php to implement locking as a configurable parameter; it
> would be great if it got done so that I don't have to patch it myself and
> remember to apply the patch again when upgrading.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)