Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging - single not logging #390

Open
trondhuso opened this issue Feb 24, 2022 · 4 comments
Open

Logging - single not logging #390

trondhuso opened this issue Feb 24, 2022 · 4 comments

Comments

@trondhuso
Copy link

Logging channel single does not log to file. I believe the reason is because Laravel has the structure storage/logs which is not present in Zero

I could be wrong.

@markbiek
Copy link

I've having this exact issue. I followed the directions in Logging.

I set logging.php to use single by default

'default'  => env(
		'LOG_CHANNEL',
		'single'
	),

and the single channel is unchanged

'single'     => array(
			'driver' => 'single',
			'path'   => storage_path( 'logs/laravel.log' ),
			'level'  => 'debug',
		),

I also manually created the storage/logs/laravel.log file and set it world-writable. I also verified that storage_path() is returning the correct path.
image

But when I run Log::info at the beginning of my command, nothing gets logged.

@owenvoke
Copy link
Member

owenvoke commented Feb 28, 2022

I'm not able to replicate this issue 🤔 I've tried on both Windows and macOS by just running php <app> app:install log and then updating the logging.default config to single as mentioned.

As a note, on my tests, it automatically created the storage/logs directory, and this didn't need to be created beforehand.

@markbiek
Copy link

markbiek commented Mar 3, 2022

I figured out the issue on my end. I have both PHP 8.0 and PHP 7.4 installed with aliases setup for php8.0 and composer8.0 when I'm running PHP 8.0 things.

My laravel-zero app is setup using PHP 8.0 but, when I run php8.0 application app:install log, it uses the default composer binary (which is tied to PHP 7.4) and fails on the composer dependencies installing the log stuff.

The issue is that Zero doesn't seem to know that composer failed so it just outputs its sample logging code which then pushes the composer error off the screen (which is why I didn't notice it before).

@cashewcodes9
Copy link

For me, I changed the default value from stack to single and it started working locally.

'default' => env('LOG_CHANNEL', 'stack'),
to
'default' => env('LOG_CHANNEL', 'single'),

Thanks for mentioning this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants