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 2016/12/30 21:37:58 UTC
[jira] [Commented] (LOG4J2-1749) YAML configuration ignores Flume
appender attribute 'type'
[ https://issues.apache.org/jira/browse/LOG4J2-1749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15788390#comment-15788390 ]
Gary Gregory commented on LOG4J2-1749:
--------------------------------------
Can you please provide your proposal as a patch with a unit test?
> YAML configuration ignores Flume appender attribute 'type'
> ----------------------------------------------------------
>
> Key: LOG4J2-1749
> URL: https://issues.apache.org/jira/browse/LOG4J2-1749
> Project: Log4j 2
> Issue Type: Bug
> Components: Core, Flume Appender
> Affects Versions: 2.7
> Reporter: Jerry Meng
>
> I try to setup the Flume appender with type 'Persistent'
> {code}
> Flume:
> name: foo
> type: Persistent
> compress: false
> ...
> {code}
> However, debug log always tells my FlumeAppender[type="null"...]
> After tracking the code, I found at JsonConfiguration#processAttributes line:237 (the super class of YamlConfiguration).
> {code}
> ...
> if (!entry.getKey().equalsIgnoreCase("type")) {
> final JsonNode n = entry.getValue();
> if (n.isValueNode()) {
> attrs.put(entry.getKey(), n.asText());
> }
> }
> ..
> {code}
> While invoking processAttributes, the attribute 'type' will be filtered out.
> I haven't dug out the reason and in what case the attribute 'type' needs to be filtered out, but I think this might accidentally mass up appenders' configuration.
--
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