Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Logging > Fingers Crossed Handler: Add stop_buffering config option #44071

Conversation

wimulkeman
Copy link
Contributor

Adding the stop_buffering config option.

The FingersCrossedHandler Logger will first start buffering log records until a record exceeds the configured action_level. When the action_level is exceeded the buffered records will be flushed to the provided log location.

By default the FingersCrossedHandler will stop buffering log records after its first flush (due to the $stopBuffering property). All records pushed to the log handler afterwards will be flushed directly to the log location.

With this config update the log handler can be configured to resume the buffering after a flush occurs.

This can be useful for applications that rely heavily on gather debug log records which only are useful when an error logging is passed. In the old setup all the debug records after an error record would be flushed to the log location.

@see https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FingersCrossedHandler.php#L73

Adding the stop_buffering config option.

The FingersCrossedHandler Logger will first start buffering log records until a record exceeds the configured action_level. When the action_level is exceeded the buffered records will be flushed to the provided log location.

By default the FingersCrossedHandler will stop buffering log records after its first flush (due to the $stopBuffering property). All records pushed to the log handler afterwards will be flushed directly to the log location.

With this config update the log handler can be configured to resume the buffering after a flush occurs.

This can be useful for applications that rely heavily on gather debug log records which only are useful when an error logging is passed. In the old setup all the debug records after an error record would be flushed to the log location.

@see https://github.com/Seldaek/monolog/blob/main/src/Monolog/Handler/FingersCrossedHandler.php#L73
@taylorotwell taylorotwell merged commit f53be1f into laravel:9.x Sep 9, 2022
@wimulkeman wimulkeman deleted the feature/enhance_fingers_crossed_handler_confg branch September 9, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants