How to activate applicative logs

  • 13 September 2022
  • 0 replies
  • 93 views

Badge +3

In this article, we will explain how to activate the applicative logs. Thoses may be useful when trying to debug or trace a particular workflow in Centreon.

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


How to activate the logs?

 

To activate the logs you need to add two variables in your .env.local.php file :

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

 

Where to find the logs?

 

Once activated and some logs are 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

 

How to choose a logs level?

 

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

Each level will activate logs from heigher values and itself. For example it 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

0 replies

Be the first to reply!

Reply