Asfakhusen
Asfakhusen

Reputation: 45

how to keep log file foreever in laravel application?

I found that log file is deleted BY end of the day from my laravel log directory. Please suggest what setting should apply to keep my log file forever.

Upvotes: 0

Views: 295

Answers (1)

Ali
Ali

Reputation: 1438

Find the following file:

vendor/laravel/framework/src/illuminate/Log/Writer.php

and find the following function:

public function useDailyFiles($path, $days = 0, $level = 'debug')
    {
        $this->monolog->pushHandler(
            $handler = new RotatingFileHandler($path, $days, $this->parseLevel($level))
        );

        $handler->setFormatter($this->getDefaultFormatter());
    }

You can set parameter for $days variable. e.g. $days = 365

Upvotes: 1

Related Questions