Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
$376 per month—let's make that $500!Learn more
Sets the log target for
Valid target values include:
- 'ECHO': Returns output to the STDOUT.
- 'HTML': Returns output to the STDOUT with HTML formatting.
- 'FILE': Sends output to a log file.
- An array with at least one element with key 'target' matching one of the valid log targets listed above. For 'target' => 'FILE' you can specify a second element with key 'options' with another associative array with one or both of the elements 'filename' and 'filepath'.
Returns the formerly set log target.
mixed setLogTarget ([string $target = 'ECHO'], mixed 1)
Set the log target to format log messages in HTML and output to the browser.
Set the log target to output anything WARN or above to a new log file that is set with 'install.' plus a timestamp of current execution (useful for install procedures).
$xpdo->setLogLevel(xPDO::LOG_LEVEL_WARN); $xpdo->setLogTarget(array( 'target' => 'FILE', 'options' => array( 'filename' => 'install.' . strftime('%Y-%m-%dT%H:%M:%S') ) ));