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

[5.7] Make the channel for log mail driver configurable #26510

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

sebdesign
Copy link
Contributor

Allows users to configure the channel for logging the emails when using the log mail driver.

By default the mails are logged to the default channel in config/logging.php, but users can configure a custom channel in the channels array. That would be handy because mail logs are often huge and messy, and it's not easy to debug along with stack traces and other log messages.

For example in config/logging.php

'channels' => [
    // ...

    'mail' => [
        'driver' => 'daily',
        'path' => storage_path('logs/mail.log'),
        'level' => 'debug',
        'days' => 14,
    ],
],

To specify the mailer to use a specific log channel instead of the default, users can set the log_channel key in config/mail.php.

'log_channel' => 'mail',

Allows users to specify the channel the log the emails when using the `log` driver.
@taylorotwell taylorotwell merged commit 5ff17b4 into laravel:5.7 Nov 14, 2018
@sebdesign
Copy link
Contributor Author

sebdesign commented Nov 14, 2018

@taylorotwell thank you for merging! Would you be interested in having this feature in the documentation? Or having a log_channel => null as a default in the config/mail.php that ships with laravel/laravel? I can submit PRs for both repositories is you want.

@driesvints
Copy link
Member

@sebdesign you can send in a PR to laravel/laravel

@sebdesign
Copy link
Contributor Author

@driesvints done! laravel/laravel#4855

@GrahamCampbell GrahamCampbell changed the title Make the channel for log mail driver configurable [5.7] Make the channel for log mail driver configurable Nov 15, 2018
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.

3 participants