[
https://issues.apache.org/jira/browse/LOG4J2-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14347869#comment-14347869
]
Ralph Goers commented on LOG4J2-969:
------------------------------------
The stackoverflow link you provided already seems like it was answered
correctly.
The SyslogAppender does not accept arbitrary layouts because it is intended to
conform to either the original syslog format or RFC 5424. No other Layout
should be permitted.
The SyslogAppender is really nothing more than the SocketAppender with one of
those two Layouts hardwired into it. If you want to use an arbitrary layout
just use that. Just be aware that if you use other layouts your system logs may
not properly accept the events.
The SyslogLayout should allow you to add thread context data to the message
portion. I believe we discussed allowing the msg portion of the syslog record
to be formatted using a pattern but have not done that because not all pattern
converters should be allowed. See LOG4J2-256.
> Refactor syslogappender so that Layout is an PluginElement
> ----------------------------------------------------------
>
> Key: LOG4J2-969
> URL: https://issues.apache.org/jira/browse/LOG4J2-969
> Project: Log4j 2
> Issue Type: Improvement
> Components: Appenders, Layouts
> Affects Versions: 2.2
> Reporter: Paul D Johe
> Labels: syslog, syslogappender
>
> There are quite a lot of attributes to the syslogappender that could have
> been simply included as:
> {code}
> @PluginElement("layout") Layout<? extends Serializable> layout,
> {code}
> This is much more flexible (for example, extension of existing syslog
> layouts) and the field 'format' becomes superfluous, as it is implied by the
> layout chosen (normally SyslogLayout or Rfc5424Layout will be chosen).
> Furthermore, it becomes much clearer which attributes are for the RFC5424
> format and which are for the BSD format.
> Or at least add the possibility for a Layout element, which if does not exist
> will use the existing code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]