Skip to content

Using ConsoleLogger in a Laravel project #606

Answered by Lukasss93
sr-44 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, just do this:

You need to create the nutgram channel inside the config/logging.php file:

'nutgram' => [
    'driver' => 'monolog',
    'level' => env('LOG_LEVEL', 'debug'),
    'handler' => StreamHandler::class,
    'formatter' => Nutgram\Laravel\Log\NutgramFormatter::class,
    'with' => [
        'stream' => 'php://stderr',
    ],
    'processors' => [PsrLogMessageProcessor::class],
],

Then add the nutgram channel to the TELEGRAM_LOG_CHANNEL env var:

TELEGRAM_LOG_CHANNEL=nutgram

Output:

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sr-44
Comment options

@Lukasss93
Comment options

@azbagas
Comment options

Answer selected by sr-44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants