logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Ståldal (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-1465) Default layouts for various appenders could be more consistent
Date Thu, 15 Sep 2016 16:09:20 GMT

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

Mikael Ståldal edited comment on LOG4J2-1465 at 9/15/16 4:08 PM:
-----------------------------------------------------------------

I don't think the current defaults for JmsAppender, KafkaAppender, SocketAppender, JeroMQAppender
are reasonable, they should be default-less and require an explicit layout configuration.
But we probably better keeping the current defaults anyway to preserve BC.

But next time we add a new appender, we should consider to make it default-less.


was (Author: mikaelstaldal):
I don't think the current defaults for JmsAppender, KafkaAppender, SocketAppender, JeroMQAppender
are reasonable. But we probably better keeping them anyway to preserve BC.

But next time we add a new appender, we should consider to not giving it a default layout.

> 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
default.
> 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
(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


Mime
View raw message