diff --git a/lib/fluent/plugin/parser_json.rb b/lib/fluent/plugin/parser_json.rb index 19160ce624..50a80a31c9 100644 --- a/lib/fluent/plugin/parser_json.rb +++ b/lib/fluent/plugin/parser_json.rb @@ -52,9 +52,15 @@ def configure_json_parser(name) else raise "BUG: unknown json parser specified: #{name}" end - rescue LoadError + rescue LoadError => ex name = :yajl - log.info "Oj is not installed, and failing back to Yajl for json parser" if log + if log + if /\boj\z/ =~ ex.message + log.info "Oj is not installed, and failing back to Yajl for json parser" + else + log.warn ex.message + end + end retry end