Laravel 默认创建具有664权限的日志文件

Laravel 默认创建具有664权限的日志文件,laravel,ubuntu,Laravel,Ubuntu,如何配置我的Laravel或Ubuntu服务器,以便我的Laravel记录器创建具有664权限的日志文件?现在它默认为644。 打开config\logging.php文件,将权限键添加到默认日志通道。此功能似乎可从中获得 示例: return [ 'channels' => [ 'single' => [ 'driver' => 'single', 'path' => storage_path('l

如何配置我的Laravel或Ubuntu服务器,以便我的Laravel记录器创建具有664权限的日志文件?现在它默认为644。

打开
config\logging.php
文件,将
权限
键添加到默认日志通道。此功能似乎可从中获得

示例:

return [
    'channels' => [
        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'permission' => 0664, // this is the new key to add
        ],
    ],
];
注意事项:

return [
    'channels' => [
        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => env('LOG_LEVEL', 'debug'),
            'permission' => 0664, // this is the new key to add
        ],
    ],
];
  • 在此示例中,默认日志通道为
    single
  • 确保
    权限
    键的值不带引号且前导为零。请在中阅读更多关于此的信息