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

[5.7] Lenient log stacks #27308

Merged
merged 1 commit into from Jan 28, 2019

Conversation

Projects
None yet
2 participants
@Propaganistas
Copy link
Contributor

Propaganistas commented Jan 25, 2019

A simple yet powerful addition to the stack log driver: whenever a log stack is marked as lenient, the stack gets wrapped in the WhatFailureGroupHandler. Taken from Monolog's documentation:

This handler extends the GroupHandler ignoring exceptions raised by each child handler. This allows you to ignore issues where a remote tcp connection may have died but you do not want your entire application to crash and may wish to continue to log to other handlers.

So in this case log handlers throwing exceptions themselves are gracefully ignored, allowing the stack to continue. Highly useful to prevent white screens in production when for instance Slack cannot be reached.

I had a hard time choosing the right keyword (lenient, tolerant, continue, ignore_exceptions, ...), so please adjust as desired.

Disclaimer: I know this can be accomplished by tapping into the Monolog instance (tap) and rebinding the handler, but since it is such a useful thing I figured suggesting it as a config would be appropriate and helpful to many that are unaware of the possibility.

@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Jan 28, 2019

Lol... that's a great class name from Monolog :)

@taylorotwell taylorotwell merged commit 8999f5e into laravel:5.7 Jan 28, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@taylorotwell

This comment has been minimized.

Copy link
Member

taylorotwell commented Jan 28, 2019

Renamed option to ignore_exceptions.

@Propaganistas Propaganistas deleted the Propaganistas:5.7-lenient-log branch Jan 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment