PHP code example of crasivo / bitrix-monolog

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

    

crasivo / bitrix-monolog example snippets


use Crasivo\Bitrix\Monolog\ServiceLocator as MonologLocator;

$locator = MonologLocator::getInstance();
$logger = $locator->getLogger('default');
$logger->info('Hello world!');

logger()->info('Hello world!');

return [
    'exception_handling' => [
        'value' => [
            'debug' => false,
            'handled_errors_types' => E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE,
            'exception_errors_types' => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_USER_WARNING & ~E_USER_NOTICE & ~E_COMPILE_WARNING & ~E_DEPRECATED,
            'ignore_silence' => false,
            'assertion_throws_exception' => true,
            'assertion_error_type' => E_USER_ERROR,
            'log' => [
                'class_name' => Crasivo\Bitrix\Monolog\ExceptionHandlerLog::class,
                'settings' => [
                    'logger' => 'default',
                ],
            ],
        ],
        'readonly' => true,
    ],
];