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

Allow to use env var for log levels of console logger #448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 19, 2022

Following #446

The console logger have a map of verbosity => log level that should be configurable with env vars.

Disadvantage: in case of invalid log level, the exception cannot be contextualized with the output verbosity.

The tests in this PR will conflict with #439

$level = Logger::toMonologLevel(is_numeric($level) ? (int) $level : $level);
}
} catch (\Psr\Log\InvalidArgumentException $e) {
throw new InvalidConfigurationException(sprintf(
Copy link
Member Author

Choose a reason for hiding this comment

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

To keep this validation, we could evaluate the value at build time, but pass the configured value (with env placeholder).

https://github.com/symfony/monolog-bundle/pull/446/files#diff-3ee12206c3b122be4593dbfdb19397c16b3d337f759fad3bde6c785d6f1261c0L50-L75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants