1. Go to this page and download the library: Download bnomei/kirby3-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/ */
bnomei / kirby3-monolog example snippets
monolog()->info('test-' . md5((string) time()), [
'title' => $page->title(), // field will be normalized
'page' => $page->id(),
]);
// write to channel 'default' which writes to file
// defined at 'bnomei.monolog.file' callback
$log = \Bnomei\Log::singleton()->channel('default');
// is same as
$log = monolog('default');
// or simply
$log = monolog();
// get a logger instance by channel by name
$securityLogger = monolog('security');
$log = monolog();
$log->warning('Foo');
// or with method chaining
monolog()->error('Bar');
monolog()->info('Adding a new user', [
'username' => $user->name(),
]);
// increment Field `visits` in current Page
$page = $page->increment('visits');
monolog()->info('Incrementing Field', [
'page' => $page->id(),
'visits' => $page->visits()->toInt(),
]);
return [
// other config settings ...
// (optional) add custom channels from other plugins
'bnomei.monolog.channels.extends' => [
'myplugin.name.channels', // array of channel definitions in your other option
],
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.