webCOMAND

repo::log_to_file()

Starts writing events logged to the repo::SystemLog to a file, in addition to maintaining the repo::SystemLog.  Writing will end when the repo is destroyed/released from memory.

Prototype

string log_to_file(string $filename = NULL)

Parameters

  • filename - Optional, full file path where to write the logged events.  If not specified, it will default to a log file in the temporary path, as configured in config.php under io_comand > comand > temp_path (default is webcomand/system/tmp)

Return

Returns the file path to the log file.

Example

$repo->log_to_file("/var/www/webcomand/files/logs/comand.log");

Related

log::log_alert()