Logging
Description
The Automation Framework has a logger that can be used anywhere in the code to output events. The second optional parameter will define a log level, which can be anything as it’s just a text field.
For consistency, we recommend the following log levels:
Levels
Log::emergency($message);
Log::alert($message);
Log::critical($message);
Log::error($message);
Log::warning($message);
Log::notice($message);
Log::info($message);
Log::debug($message);
Example Use
<?php
isp_log("This is an example of logging. This event will be INFO");
isp_log("Another example of logging. This will be an ERROR", "ERROR");
Output
tail -f storage/logs/20190706.log
2019-07-06 17:00:05:INFO:IS API syncServiceUsage joe.tester@realm.co.za updated new usage 755.89
2019-07-06 17:00:05:ERROR:IS API syncServiceUsage MyUsername2@realm.co.za does not exist
References
TODO
Notes about the Unix log file and WHMCS logging
{{ $related := .Site.RegularPages.Related . }}