quarkiverse / quarkus-logging-splunk

Quarkus extension to be able to send logs to a Splunk HTTP Event Collector
Apache License 2.0
11 stars 11 forks source link

feat: support named log filter #245

Closed rquinio1A closed 2 months ago

rquinio1A commented 5 months ago

Closes #244

Some logic has to be duplicated from LoggingResourceProcessor/LoggingSetupRecorder due to lack of build items.

Also Quarkus core registers a global LogCleanupFilter after named handlers initialization, so we need to implement #setFilter rather as an #addFilter.

edeweerd1A commented 2 months ago

Question: why is the new configuration entry Optional\ and not Optional<List\>? Is it not possible to plug multiple filters?

rquinio1A commented 2 months ago

Question: why is the new configuration entry Optional and not Optional<List>? Is it not possible to plug multiple filters?

The JUL API only supports one (https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/Handler.html#setFilter(java.util.logging.Filter) so I guess that's why Quarkus handlers did the same. If we're ok deviating a bit from Quarkus core, we could use a CompositeFilter that combines several named filters.

vietk commented 2 months ago

Seems good for me