[logback-dev] Modifying behaviour of the SyslogAppender

friso.vrolijken at gmail.com friso.vrolijken at gmail.com
Wed Feb 15 14:19:00 CET 2017


Hi all, 

I'm trying to change the behaviour of the SyslogAppender. One of the things I'd like is short hostnames and I’m not the only one: 
http://logback.10977.n7.nabble.com/Syslog-Appender-Short-Host-Name-td1102.html
https://github.com/qos-ch/logback/pull/139/files
https://jira.qos.ch/browse/LOGBACK-1011 

I find that this is really hard and struggle to understand why. There are a couple of things that make this hard, in my opinion: 
1. You can't set a Layout on a SyslogAppender. (as long as this is the case, you might as well remove the null check in start())
    public void setLayout(Layout<E> layout) {
        addWarn("The layout of a SyslogAppender cannot be set directly. See also " + SYSLOG_LAYOUT_URL);
    }
2. Both the Layout and the stackTraceLayout use (independent) instanceConverterMap to add the SyslogConverter. If the converter had been set to the defaults or the context I could override it. 

While I can supply a patch, I'm curious if this was a deliberate decision. Also I’m not quite clear on what the responsibilities of the SyslogAppenderBase vs the SyslogAppender are. What should happen in the base and what should be left for the implementation?

Having it like this it's hard to e.g. create a converter that is compliant with rfc5424, or support other behaviours. 
There are a number of attempts/issues for the RFC5424; 
https://jira.qos.ch/browse/LOGBACK-588
https://github.com/qos-ch/logback/pull/72/files 

Any thoughts?

Groeten,

Friso

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-dev/attachments/20170215/2336e004/attachment.html>


More information about the logback-dev mailing list