Skip to main content

Please note that the only procedures supported and maintained by Centreon are those published in the official documentation. If you have a question about this article, post it in the comments.


In this article, we will explain how to activate applicative logs. These are useful when trying to debug actions carried out by the API, or trace a particular workflow in Centreon. Use them when error messages in the interface don't help you enough and you need more information to solve your problem.

Note that these logs are not available in all of Centreon yet, you will find them mainly in recent and new features.
 

How to activate the logs?

 

Applicative logs are not enabled by default. As they can have an impact on performance, we recommend that you use them only temporarily when you really need them.


To activate the logs, edit your /usr/share/centreon/.env.local.php file. Add 'APP_DEBUG' => true, and set the log level using the 'DEBUG_LEVEL' variable. In the exemple below, the log level is set to 100, i.e. “debug”.

return array (
...
'APP_DEBUG' => true,
'DEBUG_LEVEL' => 100
);


How to choose a log level?

 

The log level determines what kind of information will be logged.

Each value will activate logs with the corresponding level, as well as all higher logs. For example if you choose to set the level at 400, logs of type EMERGENCY, ALERT, CRITICAL and ERROR will be logged.

 

Log level Value
EMERGENCY 600
ALERT 550
CRITICAL 500
ERROR 400
WARNING 300
NOTICE 250
INFO 200
DEBUG 100


Where can I find the logs?

 

Once you have activated the logs and some logs have been generated, you will find them in a new file, /var/log/centreon/centreon-web.log.

Here is an example of logs you could find:

[2022-08-10T10:40:49+0200] [debug] [EventSubscriber\UpdateEventSubscriber:69]: Checking if route matches updates endpoint 
[2022-08-10T10:40:49+0200] [info] [EventSubscriber\WebSSOEventSubscriber:188]: finding web-sso configuration
[2022-08-10T10:40:49+0200] [info] [Core\Application\Platform\UseCase\FindInstallationStatus\FindInstallationStatus:47]: check installation status of centreon web
[2022-08-10T10:40:49+0200] [debug] [EventSubscriber\UpdateEventSubscriber:69]: Checking if route matches updates endpoint
[2022-08-10T10:40:49+0200] [info] [EventSubscriber\WebSSOEventSubscriber:188]: finding web-sso configuration
[2022-08-10T10:40:49+0200] [notice] [Security\Domain\Authentication\AuthenticationService:86]: [AUTHENTICATION SERVICE] token not found
[2022-08-10T10:40:49+0200] [debug] [Core\Security\Infrastructure\Repository\DbWriteTokenRepository:56]: Deleting expired refresh tokens
[2022-08-10T10:40:49+0200] [debug] [Core\Security\Infrastructure\Repository\DbWriteTokenRepository:77]: Deleting expired tokens which are not linked to a refresh token

 

Be the first to reply!