PHP code example of presprog / kirby-monolog
1. Go to this page and download the library: Download presprog/kirby-monolog library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
presprog / kirby-monolog example snippets
// Write to the default log file
monolog()->log('something happend 😱');
// Log to another channel (only changes the filename for now)
// Will log to "your-log-dir/other-channel-$date.log"
monolog('other-channel')->log('something happend 😱');
// Change the log level (any of \Psr\Log\LogLevel)
monolog()->log('something CRITICAL happend 😱', 'critical');
// …
try {
// ..
} catch(\Exception $exception) {
site()->logException($exception)
}