Child pages
  • laravel daily log permission 문제 해결

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<?php

use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;

//++++++++ 추가
// console 실행 여부 판단해서 채널 분리
$log_channel =  env('LOG_CHANNEL', 'stack');
if ($app->runningInConsole()) {
    $log_channel = 'cli';
}
//++++++++ 추가끝

return [
  'default' => $log_channel, // 변경

  'channels' => [
    'stack' => [
        'driver' => 'stack',
		// cli 채널 추가
        'channels' => ['daily'],
    ],
	// console 용 channel
   'cli' => [
    'driver' => 'daily',
    'path' => storage_path('logs/laravel-cli.log'),
    'level' => 'debug',
    'days' => 14,
],



5.5 이하 

5.5 이하는 configbootstrap/app.php 에 custom log 를 설정해 줍니다.

...