Open rasmuscc opened 2 weeks ago
/cc @dmlloyd (logging)
We could approach this in two different ways:
Which solution offers the best performance? Also, isn't it in theory possible for cycles to exist in the cause chain?
I think the latter is likely to have the lowest run time overhead. And yes, cycles may exist in the causes chains but that isn't insurmountable.
Thank you for the answer! I think the latter sounds like the "nicest" solution.
Description
Currently, it's possible to filter log messages in Quarkus by creating a @LoggingFilter, which provides access to java.util.logging.LogRecord. However, I think there’s a limitation when it comes to sanitizing logged exception messages.
The issue is that while I can access the LogRecord's cause, it’s immutable. To sanitize exception messages, I think I'd need to iterate through the cause chain and create a new exception with an updated message for each cause which is cumbersome.
It would be beneficial to have a filter that directly applies to the final output written to the console. This would allow for easier sanitization of exception messages without needing to recreate the cause chain.
Implementation ideas
No response