PHP code example of neeckeloo / monolog-module

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

    

neeckeloo / monolog-module example snippets


return [
    'monolog' => [
        'loggers' => [
            'Log\App' => [
                'name' => 'default',
            ],
        ],
    ],
];

return [
    'monolog' => [
        'loggers' => [
            'Log\App' => [
                'name' => 'default',
                'handlers' => [
                    'stream' => [
                        'name' => StreamHandler::class,
                        'options' => [
                            'path'   => 'data/log/application.log',
                            'level'  => Logger::DEBUG,
                        ],
                    ],
                    'fire_php' => [
                        'name' => FirePHPHandler::class,
                    ],
                ],
            ],
        ],
    ],
];

return [
    'monolog' => [
        'loggers' => [
            'Log\App' => [
                'name' => 'default',
                'handlers' => [
                    'default' => [
                        'name' => StreamHandler::class,
                        'options' => [
                            'path'   => 'data/log/application.log',
                            'level'  => Logger::DEBUG,
                        ],
                    ],
                ],
                'processors' => [
                    UidProcessor::class,
                    WebProcessor::class,
                ],
            ],
        ],
    ],
];

return [
    'monolog' => [
        'loggers' => [
            'Log\App' => [
                'name' => 'default',
                'handlers' => [
                    'default' => [
                        'name' => StreamHandler::class,
                        'options' => [
                            'path'   => 'data/log/application.log',
                            'level'  => Logger::DEBUG,
                        ],
                        'processors' => [
                            UidProcessor::class,
                            WebProcessor::class,
                        ],
                    ],
                ],
            ],
        ],
    ],
];

$logger = $serviceManager->get('Log\App');
$logger->debug('debug message');