marvinlabs / laravel-discord-logger

Logging to a discord channel in Laravel
MIT License
175 stars 41 forks source link

Include the system's ip when logging #14

Closed jhemmmm closed 4 years ago

jhemmmm commented 4 years ago

Hello,

I've been receiving quite a lot of problem with the logger. SInce I do have multiple running servers to run the my laravel app and it's on load balancer. I don't know which server is getting the errors.

vpratfr commented 4 years ago

Hi,

You can simply add a processor to Monolog. That will be used to push extra context to all your log messages (bonus: it will not only do that for Discord but for all other channels too)

See: https://seldaek.github.io/monolog/doc/01-usage.html#using-processors

jhemmmm commented 4 years ago

Thanks, how do I do this. laravel does not seem to have a documentation about using processors.

vpratfr commented 4 years ago

You can try to post your question on stackoverflow, pretty sure you'll get some pointers there. And having a look at the laravel source code around the log facade would also help.