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

Document the bref/logger package #360

Merged
merged 3 commits into from
Jul 4, 2019
Merged

Document the bref/logger package #360

merged 3 commits into from
Jul 4, 2019

Conversation

mnapoli
Copy link
Member

@mnapoli mnapoli commented Jun 27, 2019

This PR documents and makes official the bref/logger package.

This package is a PSR-3 logger designed for AWS Lambda. In other words, it logs everything into stderr so that logs end up in CloudWatch.

This is a lightweight alternative to Monolog, and it is ready to use without having to configure Monolog handlers. It is also a bit more limited as it has no extension points.


By default, all PHP errors, warnings and notices emitted by PHP will be forwarded into CloudWatch.

That means that you don't have to configure anything to log errors, warnings or uncaught exceptions.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clarification on the current behavior regarding errors.

@miketheman
Copy link
Contributor

I like the idea of a Cloudwatch specific logger.
Have you considered making the behavior configurable via env var, like other loggers?
I read https://laravel.com/docs/5.8/logging#configuration and thought it a clean approach for local dev vs deployed environment.

@mnapoli
Copy link
Member Author

mnapoli commented Jun 29, 2019

@miketheman When running locally with SAM or serverless it should work (because stderr is displayed in the console).

When running locally with php -S it will also work AFAIK.

So it should be good here!

@mnapoli mnapoli merged commit 8e67dfd into master Jul 4, 2019
@mnapoli mnapoli deleted the document-bref-logger branch July 4, 2019 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants