electric icon indicating copy to clipboard operation
electric copied to clipboard

Feature request: basic logger filters

Open cyeb opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. My logs are full of health check logs (i.e., GET /v1/health and its response). I'd like the ability to filter out these logs.

Describe the solution you'd like Ideally, I'd like the sync service to expose a way to filter logs (perhaps regex or basic string match). Less nice but still adequate is a param to filter out specifically health check logs.

cyeb avatar Apr 27 '25 00:04 cyeb

Hi @cyeb, thanks for interest in the project!

That's an interesting idea, but I don't believe I've seen log filtering as an option on many products. What gives you the inspiration? And, from your side, would it be possible to filter out the logs on ingestion? I believe fluentd and other logging integrations should have support for this out of the box, but I'm not sure what you're using.

icehaunter avatar Apr 28 '25 11:04 icehaunter

This could also perhaps be solved by log levels? So only have the production instance output error logs.

KyleAMathews avatar Apr 28 '25 13:04 KyleAMathews

I don't believe I've seen log filtering as an option on many products

I've seen health-check filtering on a few big projects:

  1. This is RabbitMQ's default behavior: "Connections that do not send any data, such as health checks of certain load balancer products, will not be logged."
  2. HAProxy has an http-ignore-probes option.

would it be possible to filter out the logs on ingestion?

I'm not sure how easy this is since request/response logs are split across different lines, and response logs don't contain the path being requested, making it hard to filter at ingest level.

This could also perhaps be solved by log levels? So only have the production instance output error logs.

I'd like to keep logging all network request/response logs except for health-checks. But since these are all logged to the info level, I can't use log level filters for this.

Also speaking of debug levels, I feel the debug and info levels should maybe be swapped. Imo, the debug level contains both higher level and more useful information than info, such as when clients register and wait, and which tables are found. This is significantly more useful and less spammy than network logs, which I think most services push to debug. Swapping these levels would also be adequate for my current needs (but would still prefer ability to filter specifically health check logs, if possible).

cyeb avatar Apr 28 '25 19:04 cyeb