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

text correction? #5370

Closed
ghost opened this issue Jun 8, 2015 · 6 comments
Closed

text correction? #5370

ghost opened this issue Jun 8, 2015 · 6 comments
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. Logger

Comments

@ghost
Copy link

ghost commented Jun 8, 2015

http://symfony.com/doc/current/cookbook/logging/monolog_email.html

The mail handler is a fingers_crossed handler which means that it is only triggered when the action level, in this case critical is reached. It then logs everything including messages below the action level. The critical level is only triggered for 5xx HTTP code errors.

Is it below the action level or above the action level?

@snoek09
Copy link

snoek09 commented Jun 10, 2015

That should be above the action level based on the tip text below that part:

If you want both 400 level and 500 level errors to trigger an email, set the action_level
to error instead of critical. See the code above for an example.

@ghost
Copy link
Author

ghost commented Jun 15, 2015

Now i hopefully understand the text: It then logs everything including messages below the action level.

May be this text should be easier to understand:
The mail handler is a fingers_crossed handler which means that it is only triggered when the action level, in this case critical is reached. The critical level is only triggered for 5xx HTTP code errors. But If the level is reached once, the finger_crossed handler will log everything, including messages below the action level.

am i right?

@snoek09
Copy link

snoek09 commented Jun 17, 2015

From https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/FingersCrossedHandler.php#L19

Buffers all records until a certain level is reached

The advantage of this approach is that you don't get any clutter in your log files.
Only requests which actually trigger an error (or whatever your actionLevel is) will be
in the logs, but they will contain all records, not only those above the level threshold.

@xabbuh xabbuh added good first issue Ideal for your first contribution! (some Symfony experience may be required) actionable Clear and specific issues ready for anyone to take them. Logger labels Jun 17, 2015
@xabbuh
Copy link
Member

xabbuh commented Jun 17, 2015

@bokonet @snoek09 Does anyone of you like to create a pull request for this?

@snoek09
Copy link

snoek09 commented Jun 17, 2015

@xabbuh I would like to. Not sure about the definitive text though.

After reading the FingersCrossedHandler comment it seems the cookbook documentation is right.
I agree it's a bit confusing.

@snoek09
Copy link

snoek09 commented Jun 19, 2015

@xabbuh there's a pull request: #5414

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Jun 22, 2015
weaverryan added a commit that referenced this issue Jun 29, 2015
…el (snoek09)

This PR was merged into the 2.3 branch.

Discussion
----------

Rewrite sentence about fingers crossed handler action level

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets | #5370

Commits
-------

ebebe1d 5370 simplify original sentence
2982000 5370 rewrite sentence about fingers crossed handler action level
@xabbuh xabbuh closed this as completed Jun 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required) hasPR A Pull Request has already been submitted for this issue. Logger
Projects
None yet
Development

No branches or pull requests

2 participants