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

If queue or database is unavailable, emergency logging should be used #41

Closed
joostdebruijn opened this issue Jul 3, 2021 · 3 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@joostdebruijn
Copy link
Contributor

When using this log channel with queueing and the queue is unavailable (e.g. Redis is not running or the database is unavailable), I would expect that errors occuring at that moment will be logged to the emergency channel. However, I don't see those errors logged anywhere. Maybe it's a configuration thing, however - in that case it would be nice to add something about it in the documentation.

@danielme85
Copy link
Owner

Sorry for the late response here, busy with work and house and life and all that!

That's actually a very good point, I think I just got used to doing the whole stack log channel with db+daily so I could always fall back to a log file. However, that means that I would double store all logging.

I'll take a look at this, need to make sure this thing still works on the newest Laravel updates anyways ;)

Thank you for the feedback, much appreciated!

@danielme85 danielme85 self-assigned this Sep 22, 2021
@danielme85 danielme85 added the enhancement New feature or request label Sep 22, 2021
@danielme85
Copy link
Owner

Hi @joostdebruijn,
I'm working on adding a Monolog Logger that basically just adds the log event + exception info to PHP's native error_log if writing to DB fails. This would require a working error_log setting in PHP (obviously), but other than that it should be pretty straightforward.

https://github.com/danielme85/laravel-log-to-db/blob/v3.1/src/LogToDbCustomLoggingHandler.php

Need to test this in practice, make sure we don't get any of those magical/wonderful infinite loops 👍

@danielme85
Copy link
Owner

This is now added in v3.0.2, thank you for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants