@dustydiamond Can you make sure that permission for storage? e.g. sudo chmod -R 775 storage/logs
Also, clearing the config?
php artisan config:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I have a problem with logging in Laravel. I'm using Laravel 10 with Jetstream (Laravel v10.45.1 (PHP v8.3.3) to be precise)
Now my problem is, that none of my tries to log into logfiles via Log:: works.
For example: I have a Usercontroller, where I update the users roles (via spatie) and want to log that event.
public function update(Request $request)
{
$validatedData = $request->validate([
'user_id' => 'required|exists:users,id',
'roles' => 'array',
]);
$user = User::findOrFail($request->user_id);
$user->roles()->sync($request->input('roles', []));
Log::info('Edited Info for user {givenName} {sn}', ['givenName' => $user->givenName, 'sn' => $user->sn]);
return redirect()->back()->with('success', 'User successfully updated');
}
now this Log-Message never gets created in the logfiles, but laravel isn't throwing an error, so I guess the syntax is correct. The weird part is, that errors generated from the console get logged. For example if I try to call php artisan pail while not having pail installed I get the error message written to the logfiles.
Below my logging.php (excerpts):
'default' => env('LOG_CHANNEL', 'stack'),
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'daily'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => env('LOG_SINGLE_PATH', 'storage/logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'permissions' => 0775,
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => env('LOG_DAILY_PATH', 'storage/logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'permissions' => 0775,
'days' => 14,
'replace_placeholders' => true,
],
[...]
'emergency' => [
'path' => env('LOG_EMERGENCY_PATH', 'storage/logs/laravel.log'),
],
],
and corresponding .env parts:
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
LOG_SINGLE_PATH="storage/logs/laravel.log"
LOG_DAILY_PATH="storage/logs/laravel.log"
LOG_EMERGENCY_PATH="storage/logs/laravel-emergency.log"
I would appreciate any help with this. :)
It might be because of your configuration, seems like the storage_path() helper method is removed
Try to update config like this:
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'daily'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path(env('LOG_SINGLE_PATH', 'logs/laravel.log')),
'level' => env('LOG_LEVEL', 'debug'),
'permissions' => 0775,
'replace_placeholders' => true,
],
'daily' => [
'driver' => 'daily',
'path' => storage_path(env('LOG_DAILY_PATH', 'logs/laravel.log')),
'level' => env('LOG_LEVEL', 'debug'),
'permissions' => 0775,
'days' => 14,
'replace_placeholders' => true,
],
[...]
'emergency' => [
'path' => storage_path(env('LOG_EMERGENCY_PATH', 'logs/laravel.log')),
],
And update this in your ENV
LOG_SINGLE_PATH="logs/laravel.log"
LOG_DAILY_PATH="logs/laravel.log"
LOG_EMERGENCY_PATH="logs/laravel-emergency.log"
Please or to participate in this conversation.