DEV Community

Al-Amin Islam
Al-Amin Islam

Posted on

1

Laravel logging

To help you learn more about what's happening within your application, Laravel provides robust logging services that allow you to log messages to files, the system error log, and even to Slack to notify your entire team.

In this folder there have the log file.

storage/logs
Enter fullscreen mode Exit fullscreen mode

We can create laravel custom log file. Go to the config\logging.php

//By default have 
  'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'replace_placeholders' => true,
        ],

//here is the custom log example:

'custom' => [
            'driver' => 'single',
            'path' => storage_path('logs/custom.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'replace_placeholders' => true,
        ],
Enter fullscreen mode Exit fullscreen mode

If we want to show the every log data show our custom log file . Edit the .env file
replace

LOG_CHANNEL=stack to LOG_CHANNEL=custom
Enter fullscreen mode Exit fullscreen mode

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs