roadrunner-server / roadrunner

🤯 High-performance PHP application server, process manager written in Go and powered with plugins
https://docs.roadrunner.dev
MIT License
7.95k stars 413 forks source link

[💡 FEATURE REQUEST]: Filter logs #2073

Open devnev opened 5 days ago

devnev commented 5 days ago

Plugin

Logger

I have an idea!

In short, add an option to discard logs matching certain properties/patterns.

Motivation:

I have a global loadbalancer set up, which sends health checks to determine if the backend service is healthy. Previously these were handled by an nginx, with access logs disabled for that particular route. I've now changed the loadbalancer so the healthcheck traverses the full stack, all the way into the PHP worker managed by roadrunner. Now roadrunner is logging these requests, causing a lot of noise between logs of actual traffic. It would be great to be able to stop roadrunner from even emitting these logs.

rustatian commented 5 days ago

Hey @devnev 👋🏻 Could you please share your RR configuration (.rr.yaml)?

devnev commented 5 days ago

@rustatian I'm probably going to have to redact some of it, is there any particular bit you're looking for?

rustatian commented 5 days ago

Yeah, logs section

devnev commented 4 days ago

Logs section is

logs:
  encoding: json
  level: info
  mode: production
rustatian commented 4 days ago

I think that you may simply use channels. info is needed only for the worker logs (if you need them), for the other plugins you may error log level.

devnev commented 4 days ago

I don't think that works for me as I want to have the http logs in general but filter out certain logs (namely successful healthcheck requests)

rustatian commented 4 days ago

Yeah, in that case it makes sense.