Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Log deprecations on a dedicated Monolog channel#36621

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfroml-vo:use_deprecations_channel
May 5, 2020

Conversation

l-vo
Copy link
Contributor

@l-vol-vo commentedApr 29, 2020
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Ticketshttps://github.com/orgs/symfony/projects/1#card-35233930
LicenseMIT
Doc PRsymfony/symfony-docs#13642

This PR allows to activate a specific channel for deprecations.

Base configuration

monolog:handlers:#...deprecation:type:streampath:"%kernel.logs_dir%/%kernel.environment%.deprecations.log"deprecation_filter:type:filterhandler:deprecationmax_level:infochannels:["php"]

Deprecation specific channel enabled:

monolog:channels:['deprecation']handlers:#...deprecation:type:streamchannels:["deprecation"]path:"%kernel.logs_dir%/%kernel.environment%.deprecations.log"

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM!

I'm wondering: is there a way to make the new channel a kind of alias for the "php" one, so that deprecations follow the same path as the php logs by default?

Note: if this PR is merged, it'll be possible to remove deprecation_filter Monolog handler in the Monolog bundle recipe.

yes! and we could move them to a NullLogger by default for the prod env

@l-vol-voforce-pushed theuse_deprecations_channel branch from9867d58 to18200f8CompareApril 30, 2020 20:31
@l-vo
Copy link
ContributorAuthor

Do you mean to use the same handler(s) asphp channel if no handler if defined fordeprecation channel ?
Currently I don't see any way to do that but maybe we could add afallback (not sure for the name) tag property (with a channel name).FixEmptyLoggerPass could use the handlers defined for this channel instead ofNullHandler ?

@nicolas-grekas
Copy link
Member

Do you mean to use the same handler(s) as php channel if no handler if defined for deprecation channel ?

Yes, that's a possibility.

I fear that logging deprecations to a new channel might break apps that configured the php channel and expect deprecations to go there.

Ideally, we'd figure out a way to make the new channel opt-in somehow.

@l-vo
Copy link
ContributorAuthor

l-vo commentedMay 4, 2020

Ideally, we'd figure out a way to make the new channel opt-in somehow.

Logging to specific channel is now disabled by default (the servicemonolog.logger.deprecation doesn't exist). Adding adeprecation additional channel in monolog configuration create the service and enable the feature (see exemple inPR description)

nicolas-grekas reacted with heart emoji

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

Nice!
Please consider a doc PR as this will have to be documented appropriately.

@fabpotfabpotforce-pushed theuse_deprecations_channel branch fromfe30f8a to3d415cbCompareMay 5, 2020 05:39
@fabpot
Copy link
Member

Thank you@l-vo.

@fabpotfabpot merged commit55706f7 intosymfony:masterMay 5, 2020
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 5, 2020
@l-vol-vo deleted the use_deprecations_channel branchMay 5, 2020 08:34
@l-vo
Copy link
ContributorAuthor

l-vo commentedMay 5, 2020

PR to documentation added

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

@andrew-dembandrew-dembandrew-demb left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

5 participants
@l-vo@nicolas-grekas@fabpot@andrew-demb@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp