Skip to main content

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:

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

 

Be the first to reply!

Reply