[GH-ISSUE #1054] StreamHandler: Set $useLocking to true by default #428

Closed
opened 2026-03-04 02:14:57 +03:00 by kerem · 1 comment
Owner

Originally created by @tomsommer on GitHub (Sep 13, 2017).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1054

Would it not make sense to set $useLocking to true by default? Otherwise you risk random concurrency/permission errors.

github.com/Seldaek/monolog@7405bb5d67/src/Monolog/Handler/StreamHandler.php (L39)

github.com/Seldaek/monolog@07b6c1c417/src/Monolog/Handler/RotatingFileHandler.php (L45)

Originally created by @tomsommer on GitHub (Sep 13, 2017). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1054 Would it not make sense to set $useLocking to true by default? Otherwise you risk random concurrency/permission errors. https://github.com/Seldaek/monolog/blob/7405bb5d673df9ee05698876843e85b0b8a599d4/src/Monolog/Handler/StreamHandler.php#L39 https://github.com/Seldaek/monolog/blob/07b6c1c4171a030787f2bc961272b1887032304e/src/Monolog/Handler/RotatingFileHandler.php#L45
kerem closed this issue 2026-03-04 02:14:57 +03:00
Author
Owner

@Seldaek commented on GitHub (Jun 17, 2018):

As per https://github.com/Seldaek/monolog/issues/379 - this is only an issue if you log long lines or in very odd setups. For most use cases locking isn't needed even with high concurrency, so I don't think it's a good idea to enable by default.

<!-- gh-comment-id:397884835 --> @Seldaek commented on GitHub (Jun 17, 2018): As per https://github.com/Seldaek/monolog/issues/379 - this is only an issue if you log long lines or in very odd setups. For most use cases locking isn't needed even with high concurrency, so I don't think it's a good idea to enable by default.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#428
No description provided.