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

[FrameworkBundle] framework.php_errors.log now accept a log level#26504

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

Conversation

@Simperfit
Copy link
Contributor

@SimperfitSimperfit commentedMar 13, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#26267
LicenseMIT
Doc PRtodo

We are testing thatframework.php_errors.log is either a bool or an int (set the value of the log level you want).
Thisfixes#26267, so it gives a way to not log some level on production.

@nicolas-grekas
Copy link
Member

would be great to turn theframework.php_errors.log config entry into a "bool|int", and when an "int" is provided, use the value to set the parameter

derrabus and Simperfit reacted with thumbs up emoji

@nicolas-grekasnicolas-grekas added this to the4.1 milestoneMar 13, 2018
@SimperfitSimperfitforce-pushed thefeature/add-a-parameter-for-log-level branch fromd71b26f to5b6a4feCompareMarch 14, 2018 11:34
@Simperfit
Copy link
ContributorAuthor

@nicolas-grekas I have changed this PR, could you please guide me on how to write test for this ?

@SimperfitSimperfit changed the title[FrameworkBundle] add a parameter for the debug production log level[FrameworkBundle] framework.php_errors.log now accept a log levelMar 14, 2018
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.

for tests, please check the existing ones, I don't have specific ideas on the topic sorry

$definition =$container->findDefinition('debug.debug_handlers_listener');

if (!$config['log']) {
if (\is_bool($config['log']) &&!$config['log']) {

Choose a reason for hiding this comment

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

if (!$config['log']) { is enough:0 also disables the logger

$definition->replaceArgument(1,null);
}

if (\is_int($config['log'])) {

Choose a reason for hiding this comment

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

if (\is_int($config['log']) && $config['log']) {

->addDefaultsIfNotSet()
->children()
->booleanNode('log')
->scalarNode('log')

Choose a reason for hiding this comment

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

maybe forbid anything else than a bool|int?

Simperfit and snoek09 reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

done

@Simperfit
Copy link
ContributorAuthor

Status: Needs Review

@SimperfitSimperfitforce-pushed thefeature/add-a-parameter-for-log-level branch fromb02c7d7 toc713dcaCompareMarch 26, 2018 15:08
@Simperfit
Copy link
ContributorAuthor

Tests Fixed.

->treatNullLike($this->debug)
->validate()
->ifTrue(function ($v) {return !(\is_int($v) ||\is_bool($v)); })
->thenInvalid('The "php_errors.log" parameter should be either a int or a boolean.')
Copy link
Member

Choose a reason for hiding this comment

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

either an integer or a boolean?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@fabpot updated.

@SimperfitSimperfitforce-pushed thefeature/add-a-parameter-for-log-level branch fromc713dca to556c6c1CompareMarch 27, 2018 07:45
->treatNullLike($this->debug)
->validate()
->ifTrue(function ($v) {return !(\is_int($v) ||\is_bool($v)); })
->thenInvalid('The "php_errors.log" parameter should be either a integer or a boolean.')
Copy link
Member

Choose a reason for hiding this comment

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

an integer :)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This is good now :p.

@SimperfitSimperfitforce-pushed thefeature/add-a-parameter-for-log-level branch from556c6c1 to664f821CompareMarch 27, 2018 14:39
@fabpot
Copy link
Member

Thank you@Simperfit.

@fabpotfabpot merged commit664f821 intosymfony:masterMar 27, 2018
fabpot added a commit that referenced this pull requestMar 27, 2018
…a log level (Simperfit)This PR was merged into the 4.1-dev branch.Discussion----------[FrameworkBundle] framework.php_errors.log now accept a log level| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#26267   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        |  todo <!-- required for new features -->We are testing that `framework.php_errors.log` is either a bool or an int (set the value of the log level you want).Thisfixes#26267, so it gives a way to not log some level on production.Commits-------664f821 [FrameworkBundle] framework.php_errors.log now accept a log level
@SimperfitSimperfit deleted the feature/add-a-parameter-for-log-level branchMarch 30, 2018 09:22
nicolas-grekas added a commit that referenced this pull requestApr 9, 2018
…yrixx)This PR was merged into the 4.1-dev branch.Discussion----------[FrameworkBundle] Fixed configuration of php_errors.log| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#26504 and#26740 (wrong implementation)| License       | MIT| Doc PR        |Commits-------8e0fcf9 [FrameworkBundle] Fixed configuration of php_errors.log
@fabpotfabpot mentioned this pull requestMay 7, 2018
->children()
->booleanNode('log')
->scalarNode('log')
->info('Use the app logger instead of the PHP logger for logging PHP errors.')
Copy link
Contributor

Choose a reason for hiding this comment

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

is this really descriptive now?

@mathieu-pousse
Copy link

Hi,

This PR looks great to me, but I am not sure to ensure the aim.
Does the log level behind the scene correspond to something like 'E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT' or to DEVUG, INFO, WARN, ?

In any case, I think this should be explain in the documentation

@SublimeRaiser
Copy link

This PR looks great to me, but I am not sure to ensure the aim.
Does the log level behind the scene correspond to something like 'E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT' or to DEVUG, INFO, WARN, ?

In any case, I think this should be explain in the documentation

Here is a link to the docs:https://symfony.com/doc/current/reference/configuration/framework.html#log

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

Reviewers

@fabpotfabpotfabpot requested changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@bendaviesbendaviesbendavies left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

Deprecated error are logged on production

7 participants

@Simperfit@nicolas-grekas@fabpot@mathieu-pousse@SublimeRaiser@bendavies@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp