Closed andho closed 4 years ago
Please paste your full logging.php config. I use this package on multiple projects, and i do have the right facility set correctly.
If I set the APP_ENV to something else, it's reflected correctly in graylog2.
There is no issue when using 'gelf' channel directly with LOG_CHANNEL=gelf
, but when using LOG_CHANNEL=stack
, this issue occurs, even if the only channel in the stack is gelf
.
Using the gelf
channel directly also works correctly, so I assume this is an issue with the stack
driver.
Will file a bug report there.
I have this issue as well gelf does not work on stack
@genrmiranda I ended up not reporting this as a bug, as it seems this is the intended behavior of the stack driver. I just resolved to setting the name
field in the stack driver directly, which seems to work, If I recall correctly. If it doesn't work let me know, I'll have to dig up the code and double check.
I can confirm that following 'stack' setup is correctly setting 'facility' field when logging to 'stack' channel:
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'gelf'],
'name' => 'some facility value'
],
...
I'm having the same issue with stack driver. Log sent via channel 'gelf' has the facility defined in the name config. Logs sent to stack has the default value (which is app.env).
@romandots I don't see any issue with that. Stack is configured by laravel not by gelf package, it uses its own name.
If you want to use stack and change the name, look at the comment just before yours (I have not tested it myself)
@romandots I don't see any issue with that. Stack is configured by laravel not by gelf package, it uses its own name.
If you want to use stack and change the name, look at the comment just before yours (I have not tested it myself)
Yes indeed, you are right. The solution above is working, so it's probably not an issue.
Even when 'name' field is set in the logging configuration, 'facility' field has 'local' (app.env value) when it's sent to graylog2.
Using laravel/framework:^6.2 and hedii/laravel-gelf-logger:^4.0, with a completely new laravel project.