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

SAML2\Compat\Ssp\Logger->log is not compatible with PSR-3 #130

Closed
pradtke opened this issue Oct 11, 2018 · 0 comments
Closed

SAML2\Compat\Ssp\Logger->log is not compatible with PSR-3 #130

pradtke opened this issue Oct 11, 2018 · 0 comments

Comments

@pradtke
Copy link
Contributor

pradtke commented Oct 11, 2018

The PSR defined interface method public function log($level, $message, array $context = array()); takes a log level. PSR-3 defines the log levels as strings

https://github.com/php-fig/log/blob/3490ba5925e6dcbe6de950c5c6b8dce9f6e96eda/Psr/Log/LogLevel.php#L10-L17

The ssp compatibility logger uses a case statement with and compares them to the SSP const log levels with are ints. As a result there are no matches and nothing gets logged.

switch ($level) {
case \SimpleSAML\Logger::ALERT:
\SimpleSAML\Logger::alert($message);
break;
case \SimpleSAML\Logger::CRIT:
\SimpleSAML\Logger::critical($message);
break;

the log method should probably also handle the $context array in a similar fashion to the other methods.

pradtke added a commit to pradtke/saml2 that referenced this issue Oct 11, 2018
jaimeperez added a commit that referenced this issue Oct 15, 2018
@thijskh thijskh closed this as completed Nov 13, 2018
tvdijen pushed a commit to tvdijen/saml2 that referenced this issue Nov 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants