logfellow/logstash-logback-encoder

LogstashEncoder should throw IllegalArgumentException instead of logging an ERROR status when <providers> is used in the configuration

brenuart opened this issue · 0 comments

LogstashEncoder does not accept additional encoder besides the predefined ones. If user tries to add an extra encoder using the <encoders> configuration element, it logs an ERROR status indicating this is forbidden and proceeds. Unfortunately this error won't be visible when the configuration is processed because no context is available yet at the time the property is set. Users will therefore not know that their configuration has not been fully applied and will wonder why they are not getting the expected behaviour.

Instead of logging an error status, we should instead throw an IllegalArgumentException like when assigning an illegal value to a configuration property. This will be reported by the Logback configuration mechanism and a stacktrace will be automatically printed.