Topics

Logging

Use ipLog() function to log information or errors. All logs can be viewed in a Log section of administration panel. 

By default logs are stored for 90 days. This can be changed by setting an option ipSetOption('Log.existenceInDays', 123).

ImpressPages logger is compliant with PSR-3 standard. It means, that the logger provides 8 log levels as per RFC 5424. Those levels are emergencyalertcriticalerrorwarningnoticeinfo and debug.  Either use log method and specify log level as it's function parameter, or use special methods intended for specific log level.

Log a message

ipLog()->log('critical', 'Critical failure occured.');

Log a message with context provided

ipLog()->log('info', 'My information message', array('ip' => '192.168.0.1', 'user' => 'John Smith'));

Log an emergency message

ipLog()->emergency('Emergency error!');

Log an alert

ipLog()->alert('Alert logged');

Log a critical error

ipLog()->critical('Critical error occured');

Log an error

ipLog()->error('Error occured');

Log a warning

ipLog()->warning('My warning message');

Log a notice

ipLog()->notice('My notice message');

Log an informational message

ipLog()->info('My information message');

Log a debug message

ipLog()->debug('Debug message logged');

See also

comments powered by Disqus