Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1749

YAML configuration ignores Flume appender attribute 'type'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7
    • None
    • Core, Flume Appender
    • None

    Description

      I try to setup the Flume appender with type 'Persistent'

        Flume:
          name: foo
          type: Persistent
          compress: false
          ...
      

      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).

      ...
      if (!entry.getKey().equalsIgnoreCase("type")) {
          final JsonNode n = entry.getValue();
          if (n.isValueNode()) {
              attrs.put(entry.getKey(), n.asText());
          }
      }
      ..
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jerry.meng Jerry Meng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: