[Question] Recommended way to return a config validation error
cpmoore opened this issue · comments
Cody Moore commented
I know you're supposed to validate the configuration in the plugin constructor, but I was wondering if there was a recommended way to return an error.
Currently I'm just logging the error and setting a flag to not start the plugin. Is there a specific exception I should be throwing?
Dan Hermann commented
Typically, an IllegalStateException
is thrown so Logstash is prevented from starting with an input in an invalid state. You can see an example of that in the stdin
Java input that is included in Logstash: