<div dir="ltr">Hey everyone,<div><br></div><div>I'm interested in making a custom converter to replace the MessageConverter that renders certain objects differently depending on configuration.</div><div><br></div><div>Right now I have something like:</div><div><br></div><div><div>public class MyMessageConverter extends MessageConverter {</div><div><br></div><div>    @Override</div><div>    public String convert(ILoggingEvent event) {</div><div>        Object[] argumentArray = event.getArgumentArray();</div><div>        if (argumentArray != null) {</div><div>            for (Object o : argumentArray) {</div><div>                if (o.getClass() == BoardState.class) {</div><div>                    return MyMessageFormatter.arrayFormat(event.getMessage(), argumentArray, someOptions).getMessage();</div><div>                }</div><div>            }</div><div>        }</div><div>        return super.convert(event);</div><div>    }</div><div>}</div></div><div><br></div><div><br></div><div><br></div><div>Within 'MyMessageFormatter', which I copied from org.slf4j.helpers.MessageFormatter, I override String oAsString = o.toString(); within 'safeObjectAppend', depending on the class and the options. IE, I may want a simple string representation of a given object or something verbose. Essentially, I want to choose methods on those objects besides 'toString'.</div><div><br></div><div>It seems wrong to have to copy so much code, and would be great if MessageConverter was more extensible and didn't depend on the difficult to configure MessageFormatter. Am I going about this wrong? </div><div> </div><div><br></div></div>