Blogpost

2 minute read

View your Laravel logs on our platform

Being able to monitor logs is essential, we provide a simple way to view them on our platform.

The platform offers a log interface, which you can search, filter by date, live watch, …

But the logs shown are the Apache access and error logs.

If you are using Laravel, you want to see any error that Laravel is throwing, but these wont show up by default in the error logs.

Since Laravel is using Monolog, you can simply leverage the power of monolog and its configuration, through Laravel.

By changing some simple log configuration settings, the Laravel logs will still be logged to your preferred log channel and they will be written to the Apache error log. This is ideal since the platform will pick up these logs and show them in the interface.

For Laravel 5.6

/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
|                    "errorlog", "custom", "stack"
|
*/

'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['single', 'errorlog'],
    ],
 ....
]

For Laravel 5.5, the following configuration can be used in the app.php file:

/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/

'log' => env('APP_LOG', 'errorlog'),

'log_level' => env('APP_LOG_LEVEL', 'debug'),

Want to find out what we can do for you?