Skip to content
Discussion options

You must be logged in to vote

tap isn't limited to a custom driver — it works on any channel in config/logging.php, including the built-in single and daily ones, since under the hood they're all just Monolog-backed loggers Laravel assembles from config. You don't need a separate custom channel just to attach a processor.

// config/logging.php
'channels' => [
    'daily' => [
        'driver' => 'daily',
        'path' => storage_path('logs/laravel.log'),
        'level' => env('LOG_LEVEL', 'debug'),
        'days' => 14,
        'tap' => [App\Logging\RedactSensitiveData::class],
    ],
],

The tap class receives the Illuminate\Log\Logger instance and pushes a Monolog processor onto it:

namespace App\Logging;

class Red…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Cellard
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