Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

meeshka's avatar

LogDNA with Laravel

Has anyone tried integrating Laravel with LogDNA (https://docs.logdna.com/docs/)? Wondering what's the best way to use LogDNA or a similar service to log a particular type of errors e.g warning, error and critical only.

0 likes
3 replies
bobbybouwmann's avatar

I've used LogDNA before but not in a Laravel project.

If you want to integrate something like logging you can for example use Sentry. There is even a Laravel package: https://github.com/jenssegers/laravel-raven

Now this package is perfect for Sentry, but of course does not work for LogDNA. However you can find a lot of examples and inspiration from the package to add support for this.

1 like
chrisgo's avatar

Laravel 5.7.x or later

In config/logging.php

add logdna to channels, then add logdna to your stack if you are using that as the default

The main problem you will have is to make sure you have

 'formatter' => 'default', // very important !!!
    'channels' => [

        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'logdna'],  // ###### ADD
            'ignore_exceptions' => false,
        ],


        'logdna' => [
            'driver' => 'monolog',
            'level' => 'debug',
            'handler' => \Zwijn\Monolog\Handler\LogdnaHandler::class,
            'handler_with' => [
                'ingestion_key' => env('LOGDNA_KEY'),
                'hostname' => 'app',
            ],
            'formatter' => 'default',  // ##### does not work without this!
        ],


Please or to participate in this conversation.