Closed smortexa closed 3 years ago
@seyed-me
I thought that I had a similar problem so I looked into it.
It seems this is not an issue with Octane itself. If you server freshly installed Laravel app with Octane and try to Log::debug
, Log::info
or Log::warn
you will probably find out that it does not do anything. The default LOG_CHANNEL
is stack
. If you check the config/logging.php
you'll see that the stack
includes only channel single
by default.
In my case, the "issue" was, that besides single
I had also stderr
included in the channel list of the stack ('channels' => ['single', 'stderr']
. This caused all output from the logger to appear in the console with ERROR label.
If you look closer into https://github.com/laravel/octane/blob/1.x/src/Commands/Concerns/InteractsWithIO.php you'll see that Octane logs are being sent to the stdout. I do not thing you are able to output custom log levels into Octane's terminal output at the moment (although I might be wrong).
Try this simple demo:
Route::get('/', function () {
fwrite(STDERR, 'Lorem ipsum!');
fwrite(STDOUT, 'Hello world!' . PHP_EOL);
return view('welcome');
});
And you should see something similar in the terminal after hitting localhost:8000:
Hope this helps.
@DanCharousek is correct.
Description:
Octane labels
Log::info()
,Log::warning('bar')
andlogger()
as ERROR in terminal.Steps To Reproduce:
Log::info('foo')
orLog::warning('foo')
to logfoo
in terminal.