SYNAXON / logstash-util-formatter

Java Util Logging formatter to encode logging events as json events which can consumed by logstash.
Other
22 stars 23 forks source link

Message field doesn't expand "%s" style format strings #11

Open johnedo1234 opened 9 years ago

johnedo1234 commented 9 years ago

We're seeing log messages coming from JBoss with unexpanded "%s" format strings. Since those messages aren't coming from our code, we can't change them to use the format strings expected by the logstash-util-formatter.

johnedo1234 commented 9 years ago

Think the formatter should also support "%s"-style format strings and expand them properly.

johnedo1234 commented 9 years ago

Fixed and submitted pull request: https://github.com/SYNAXON/logstash-util-formatter/pull/12

If regular formatting produces no change to the message and there are actually parameters, falls back to String.format(). If that fails, just returns the original message.