PHP code example of johannschopplich / kirbylog

1. Go to this page and download the library: Download johannschopplich/kirbylog 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/ */

    

johannschopplich / kirbylog example snippets


kirbylog('Something happened');

kirbylog(['order' => 1042, 'status' => 'paid']);

kirbylog($response->code(), 'error');

return [
    'johannschopplich.kirbylog' => [
        'dir' => fn () => kirby()->root('site') . '/logs/app',
        'filename' => 'app.log',
        'levels' => ['info', 'warning', 'error', 'audit']
    ]
];