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

YAML configuration ignores Flume appender attribute 'type'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.7
    • Fix Version/s: None
    • Component/s: Core, Flume Appender
    • Labels:
      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

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

              Dates

              • Created:
                Updated: