Skip to content

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

Merged
taylorotwell merged 1 commit intolaravel:9.xfrom
wimulkeman:feature/enhance_fingers_crossed_handler_confg
Sep 9, 2022
Merged

[9.x] Logging > Fingers Crossed Handler: Add stop_buffering config option#44071
taylorotwell merged 1 commit intolaravel:9.xfrom
wimulkeman:feature/enhance_fingers_crossed_handler_confg

Conversation

@wimulkeman
Copy link
Copy Markdown
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