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

Expose file appender configuration details via an advertisement mechanism

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I was looking at an old rev - getContentType is now exposed - thanks!

      Now if we could add a 'getFormat':

      It would be useful to expose information about a Layout's format.

      If the content type is text/plain, exposing the layout format as a conversion pattern would work fine.

      If the content type is text/html or text/xml we could expose something else (or null).

      My primary interest is adding the ability to 'discover' the file-based logging configurations in order to support them via Chainsaw and multicast DNS.

      If all Layouts supporting text/plain content types exposed their format as a conversion pattern, and the file-based appenders (optionally) provided the ability to advertise their configuration, the files could be remotely tailed without the far endpoint even knowing anything about the file configuration.

      For an example, see how multicast appenders are exposed via zeroconf/multicast dns in log4j 1.x in activateOptions - something very similar could be done with contenttype and format properties in a fileappender with a layout.

      if (advertiseViaMulticastDNS)

      { Map properties = new HashMap(); properties.put("multicastAddress", remoteHost); zeroConf = new ZeroConfSupport(ZONE, port, getName(), properties); zeroConf.advertise(); }

        Attachments

        1. log4j2-155-feb21-rev1.patch
          55 kB
          Scott Deboy
        2. log4j2-155-feb24-rev1.patch
          68 kB
          Scott Deboy
        3. log4j2-155-jan22-rev1.patch
          52 kB
          Scott Deboy
        4. log4j2-155-jan23-rev1.patch
          57 kB
          Scott Deboy

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sdeboy Scott Deboy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: