lookfirst/jmxtrans — Issue #12: KeyOutWriter#makeNewLoggerInstance appender strategy is not reliable
Author: squat80
Created: 2012-02-08 13:14:07+00:00
State: open

Hi

in KeyOutWriter, logger is static (and its name is unique/hard-coded as "KeyOutWriter")
but each instance (i.e. each query in the configuration files) :
* can define a different filename
* add a **new** appender to the same logger each time is initialized

the result is that i get **duplicate** line for **each** metrics that get sent to the writer

in my case, 1 server def with 12 queries (each of them using the same file for KeyOutWriter) :
each is then duplicated 12 times!

i can see/suggest 2 ways to fix that :
quick fix : do not support multiple filename (only create the appender on the first instance!)
long fix : non-static logger field, static cache of logger by output filename not to duplicate loggers