logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1465) Default layouts for various appenders could be more consistent
Date Mon, 25 Jul 2016 16:19:20 GMT

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

Ralph Goers commented on LOG4J2-1465:

IMO, changing default values should rarely be done as it will impact too many users. If, however,
a default value were to cause a security vulnerability then that would be a good reason to
change it.

> Default layouts for various appenders could be more consistent
> --------------------------------------------------------------
>                 Key: LOG4J2-1465
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1465
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.6.2
>            Reporter: Mikael Ståldal
>            Assignee: Mikael Ståldal
>             Fix For: 2.7
> The appenders with layout support have different layouts as default. This could be improved,
made more consistent and better documented:
> According to documentation:
> * ConsoleAppender - pattern %m%n
> * FileAppender - no default
> * FlumeAppender - RFC5424Layout
> * JMSAppender - SerializedLayout
> * KafkaAppender - formatted message
> * MemoryMappedFileAppender - no default
> * RandomAccessFileAppender - no default
> * RollingFileAppender - no default
> * RollingRandomAccessFileAppender - no default
> * SMTPAppender - SerializedLayout
> * SocketAppender - SerializedLayout
> * JeroMQAppender - _If you do not specify a layout, the appender uses the default pattern
appender returned by PatternLayout.createDefaultLayout()_
> This is not accurate though, e.g. FileAppender (and its variants) have pattern %m%n as
> First we should update the documentation to match the implementation. But maybe we should
also consider changing some of the defaults.
> I think that pattern %m%n make sense as default for Console and the various File appenders.
> I assume that RFC5424 make sense as default for Flume, but I don't know about Flume.
> I don't think that pattern %m%n make sense as default for JeroMQ. And it was probably
a mistake (by me) to make formatted message as default for Kafka.
> And as highlighted by https://issues.apache.org/jira/browse/LOG4J2-1226 it's not good
to have SerializedLayout as default for any appender.
> I suggest that the "generic binary" appenders JMSAppender, KafkaAppender, SocketAppender
and JeroMQAppender have no default layout, make it mandatory to specify a layout for them.
That will force the user to make a conscious choice of layout, which I think is good.
> SMTPAppender should probably have pattern %m%n as default just like Console and File.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message