Open nuest opened 10 years ago
:+1: What's your preferred way of tokenizing logging statements? Have you looked at http://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html ?
I have to admit I have not considered formatting. I'd start with using the slf4 parameterized messages: http://www.slf4j.org/faq.html#logging_performance
But these only call toString(()
on objects afaik.
If not using it yet, have you given consideration to using Logback over SLF4J and using the Async logging appender? http://logback.qos.ch/manual/appenders.html#AsyncAppender
We're actually using logback, but behind SLF4J as an abtraction layer.
AsyncAppender could probably be quickly configure in the WPS's logback XML config file.
Agreed. My only hesitation in using it is it seems to drop TRACE, DEBUG and INFO levels of logging if its queue is 80% full. There's that tradeoff.
Well, I guess we could leave the old configuration in place and leave a comment there to switch back to that one if issues arise that require full TRACE log. But in a productive environment, you're probably not logging at DEBUG level anyway, right? And that is where the dropping makes sense because you're not stalling the application because of logging. But I'd have to read more about this to give a real opinion here, this is mostly guessing :smile:
I agree. It does also drop INFO, though. :(
String concatenation in log statements decrease performance, they should be replaced with placeholders. Search the whole workspace with the regexes
LOGGER*" +
andlog*" +