BMO Logging

 

Logging is accomplished through BMO using monolog and supports various add-ons and middle-ware written for monolog.

 

Starting at Framework Versions:

  • 13.0.195.26

  • 14.0.5.11

  • 15.0.1.34

Levels

LEVEL

LOGS LEVELS

LEVEL

LOGS LEVELS

DEBUG

DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY

INFO

INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY

NOTICE

NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY

WARNING

WARNING, ERROR, CRITICAL, ALERT, EMERGENCY

ERROR

ERROR, CRITICAL, ALERT, EMERGENCY

CRITICAL

CRITICAL, ALERT, EMERGENCY

ALERT

ALERT, EMERGENCY

EMERGENCY

EMERGENCY

 

Logging to the freepbx.log

php > FreePBX::Logger()->getDriver('default')->warning("warning message"); php > FreePBX::Logger()->getDriver('default')->info("info message"); php > FreePBX::Logger()->getDriver('default')->debug("debug message");   [2018-Dec-12 17:47:51] [default.WARNING]: warning message [] [] [2018-Dec-12 17:47:54] [default.INFO]: info message [] [] [2018-Dec-12 17:47:57] [default.DEBUG]: debug message [] []

 

In the above example FreePBX can be used with a created freepbx object replacing FreePBX::Logger() with something like $this->FreePBX→Logger.

 

Simple custom log

The following will log a warning message to (logpath)/mylog.log

php > FreePBX::Logger()->getDriver('mylog')->warning("warning message");

Custom path

$logger = FreePBX::Logger()->createLogDriver('mydriver', '/my/path/mylog.log', 'DEBUG'); $logger->warning('warning message');

The above will put a warning message to /my/path/mylog.log

Return to Documentation Home I Return to Sangoma Support