8000 Document new Monolog HTTP code exclusion feature by simshaun · Pull Request #8235 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Document new Monolog HTTP code exclusion feature #8235

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

Merged
merged 6 commits into from
May 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update configuration format to support URL blacklist
  • Loading branch information
simshaun committed Apr 17, 2018
commit 17cb416cea0f3ce59c1e45287aa4cf15537a86c3
11 changes: 6 additions & 5 deletions logging/monolog_exclude_http_codes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ logging these HTTP codes based on the MonologBundle configuration:
# ...
type: fingers_crossed
handler: ...
excluded_http_codes:
- 403
- 404
excluded_http_codes: [403, 404, { 400: ['^/foo', '^/bar'] }]

Copy link
Member

Choose a reason for hiding this comment

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

I think this should use the multi line format - one status code per line - I think it will be more clear.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this suggestion because I like how compact this looks ... but I don't have a strong opinion about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't mind either way. I think multi-line might be a little clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the preferred format for multi-line arrays in YAML?

A:

excluded_http_codes: [
    403, 
    404, 
    { 400: ['^/foo', '^/bar'] }
]

or B:

excluded_http_codes: 
    - 403
    - 404
    - 
        400: 
            - ^/foo
            - ^/bar

Copy link
Member

Choose a reason for hiding this comment

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

@weaverryan don't you think the expanded format is less readable in this case? The empty space in the last element in the B) notation is confusing ... and the A) format is a bit confusing too because of the way the brackets are displayed.

.. code-block:: xml

Expand All @@ -39,8 +37,11 @@ logging these HTTP codes based on the MonologBundle configuration:
<monolog:config>
<monolog:handler type="fingers_crossed" name="main" handler="...">
<!-- ... -->
<monolog:excluded-http-code>403</monolog:excluded-http-code>
<monolog:excluded-http-code>404</monolog:excluded-http-code>
<monolog:excluded-http-code code="403">
<monolog:url>^/foo</monolog:url>
<monolog:url>^/bar</monolog:url>
</monolog:excluded-http-code>
<monolog:excluded-http-code code="404" />
</monolog:handler>
</monolog:config>
</container>
Expand Down
0