<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body>
<p>Hi all,<br /><br />I have got a question about how it's possible to add a custom MDCConverter on startup even if no PatternLayoutEncoder is used?<br /><br />I have got configured a SyslogAppender (no PatternLayout possible) which uses a custom MDCConverter. How is it possible to publish this converter by adding to ch.qos.logback.classic.PatternLayout.defaultConverterMap without having other appenders? If e. g. console or file appenders are defined (with custom pattern layout which adds MDCConverter) but not used, adding to the map is done in PatternLayoutEncoder and everything works fine.<br /> <br />One (dirty?) solution I found is to add the Converter to the map with the definition of e. g.<br /><define name=“syslogMdcConverterActivator” class="my.package.SyslogMdcConverterActivator" /><br /><br /> Any suggestions?<br /><br />Thanks,<br />Martin</p>
</body></html>