Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass logging config to monolog handler preparation to allow custom formatter #145

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

Antipov-Anton
Copy link

Add possibility to set custom formatter in config/logging.php channels config.

Example of channel config:

        'sentry' => [
            'level' => 'error',
            'driver' => 'sentry',
            'formatter' => App\Logging\CustomFormatter::class,
        ],

Example of custom formatter:

<?php

namespace App\Logging;

use Monolog\Formatter\LineFormatter;

class CustomLineFormatter extends LineFormatter
{
    const SIMPLE_FORMAT = "%channel%.%level_name%: %message% %context% %extra%\n";
}

Laravel documentation (See Monolog Formatters)

resolves #142

@stayallive stayallive merged commit 1bcce34 into getsentry:master Jul 6, 2018
@stayallive
Copy link
Collaborator

Hey Anton, this is very simple, I like it! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry Logging Time Issue
2 participants