You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/09/08 18:23:45 UTC

[jira] [Commented] (LOG4J2-969) Refactor SyslogAppender so that Layout is a Plugin element

    [ https://issues.apache.org/jira/browse/LOG4J2-969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14735080#comment-14735080 ] 

Gary Gregory commented on LOG4J2-969:
-------------------------------------

That is a neat comparison. I would like having that in the docs, to make it obvious to folks how to customize the system for their specific Syslog needs.

WRT removing {{final}} modifiers, I am against it ATM:

- Making these classes extensible (non-final) will handcuff us into supporting their method signatures, even though these classes are part of the Core module and not the official public API module. We do strive to keep binary compatibility as much as possible in the Core module, but in this case I think we should have the flexibility to change these classes as long as configuration files remain compatible.
- The JVM can perform optimizations when using final classes. Removing final should only be done when we understand any (negative) performance implications.
- Since we a open-source, copy-paste, make your own layout, and you can guarantee your own backward/binary compatibility. 
- Using subclassing for some of these custom layout solutions could be considered more of a quick hack than a well designed solution. A separate (sibling) logger could be the cleaner, easier to maintain solution. I like the idea of different layouts inside a Socket appender. 
- I think we are open to patches for new kinds of layouts.

> Refactor SyslogAppender so that Layout is a Plugin element 
> -----------------------------------------------------------
>
>                 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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org