Skip to content

Conversation

rldhont
Copy link
Collaborator

@rldhont rldhont commented Jun 27, 2025

The Psr-3 Logger has seven log levels :

  • emergency
  • alert
  • critical
  • error
  • warning
  • notice
  • info
  • debug

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 level new Lizmap\Logger\Logger('info').

@rldhont rldhont added php Pull requests that update Php code backport release_3_10 labels Jun 27, 2025
@github-actions github-actions bot added this to the 3.11.0 milestone Jun 27, 2025
@rldhont rldhont requested review from Gustry, laurentj and mdouchin June 27, 2025 16:15
@rldhont rldhont marked this pull request as ready for review July 7, 2025 06:24
\lizmap::getLogger()->log($cat, $message);
} else {
\jLog::log($message, $cat);
}
Copy link
Contributor

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);

Copy link
Collaborator Author

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 ?

Copy link
Contributor

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);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

@rldhont rldhont force-pushed the psr-3-log branch 2 times, most recently from 3b6ba80 to 872bef4 Compare July 31, 2025 15:29
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
@Gustry Gustry removed their request for review September 10, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release_3_10 new feature php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants