-
-
Notifications
You must be signed in to change notification settings - Fork 151
Implementing a Psr-3 Logger upper \jLog::log #5866
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
base: master
Are you sure you want to change the base?
Conversation
Require psr/log:2.* because psr/log 3.* is in conflict with symfony/console v5.4.47 ``` Your requirements could not be resolved to an installable set of packages. Problem 1 - symfony/console v5.4.47 conflicts with psr/log 3.0.2. - symfony/console v5.4.47 conflicts with psr/log 3.0.1. - symfony/console v5.4.47 conflicts with psr/log 3.0.0. - jelix/jelix dev-jelix-1.8.x requires symfony/console ^5.4.26 -> satisfiable by symfony/console[v5.4.47]. - jelix/jelix is locked to version dev-jelix-1.8.x and an update of this package was not requested. - Root composer.json requires psr/log ^3.0 -> satisfiable by psr/log[3.0.0, 3.0.1, 3.0.2]. ``` symfony/console could not be updated to version v7 because jelix-1.8.x requires symfony/console ^5.4.26
\lizmap::getLogger()->log($cat, $message); | ||
} else { | ||
\jLog::log($message, $cat); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a long term, maybe this function should launch a deprecated
error ?
We may add a CustomLogger
acting as PSR-3 logger but for the lizadmin
file ?
// \lizmap::getAppContext()->logMessage($errormsg, 'lizmapadmin');
lizmap::getCustomLoger()->debug($errormsg);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're rights @nworr but do we still need a lizmap-admin
log ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so , the aim of "lizmap-admin" is to display on admin backend some events (and keep more sensitive events to the errors.log, unreadable for non "sysadmin" users ) .
} | ||
} else { | ||
\jLog::logEx($exception, $cat); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
The Psr-3 Logger has seven log levels :
The log levels could be defined in the LizmapConfig.ini.php file or with setLogLevel of the Logger.
A main logger is available through the lizmap singleton :
lizmap::getLogger()
or can be instantiated with it's own levelnew Lizmap\Logger\Logger('info')
.