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

Add a custom monolog formatter for Nutgram #16

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Conversation

Lukasss93
Copy link
Member

This PR adds a custom monolog formatter for Nutgram.
It's a simple formatter that shows the date, the message, the endpoint and the content/response.

Before this PR

.env file:

TELEGRAM_LOG_CHANNEL=stderr

immagine

After this PR

config/logging.php file:

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

.env file:

TELEGRAM_LOG_CHANNEL=nutgram

immagine

@Lukasss93 Lukasss93 requested a review from sergix44 October 30, 2023 22:20
@Lukasss93 Lukasss93 self-assigned this Oct 30, 2023
@Lukasss93 Lukasss93 added the enhancement New feature or request label Oct 30, 2023
@Lukasss93 Lukasss93 merged commit b89133e into master Oct 30, 2023
4 checks passed
@Lukasss93 Lukasss93 deleted the better-logging branch October 30, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants