Instead of skipping some routes, it might be preferable to change the logging level to something lower. So, if the default is info, it would be useful to be able to specify a debug level for certain routes (like a health check route).
A more complicated option might be to allow setting it based on the context, similar to the WithLogger option.
For the first option, I could see it being done something like:
Instead of skipping some routes, it might be preferable to change the logging level to something lower. So, if the default is info, it would be useful to be able to specify a debug level for certain routes (like a health check route).
A more complicated option might be to allow setting it based on the context, similar to the
WithLogger
option.For the first option, I could see it being done something like:
That would replace the default level for just that path. server and client errors would stay the same.
I'd be happy to put together a PR, if that's a feature you think would be useful. (It certainly would be useful to me)