Accumulo
  1. Accumulo
  2. ACCUMULO-2343

Create Appender specifically for log-forwarding

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.1, 1.7.0
    • Component/s: monitor, tserver
    • Labels:
      None

      Description

      Currently, the log4j configuration defines an AsyncAppender which wraps a SocketAppender. It would likely be cleaner, and easy to track, if we created our own AccumuloMonitorAppender (or similar).

      This would make disabling log-forwarding when the monitor is dead easier to accomplish. It might also allow for reuse of this functionality.

        Issue Links

        There are no Sub-Tasks for this issue.

          Activity

          Hide
          Christopher Tubbs added a comment -

          This ticket is marked for 1.6.1. I think it's probably best if these changes do not get introduced until the next feature release and not in 1.6.1, especially since full implementation will change the behavior of the logging initialization, and simply making it available means that any utilization of it would require incompatible changes to logging configuration that couldn't work with 1.6.0.

          Show
          Christopher Tubbs added a comment - This ticket is marked for 1.6.1. I think it's probably best if these changes do not get introduced until the next feature release and not in 1.6.1, especially since full implementation will change the behavior of the logging initialization, and simply making it available means that any utilization of it would require incompatible changes to logging configuration that couldn't work with 1.6.0.
          Hide
          Sean Busbey added a comment -

          We still do not have consensus that we do forward compatibility within a major version. So long as we can do backwards compatibility on logging configuration, I would want this in 1.6.1.

          Show
          Sean Busbey added a comment - We still do not have consensus that we do forward compatibility within a major version. So long as we can do backwards compatibility on logging configuration, I would want this in 1.6.1.
          Hide
          Bill Havanki added a comment -

          To make this more concrete: Here is a current example configuration using the separate, stock AsyncAppender and SocketAppender.

          <appender name="N1" class="org.apache.log4j.net.SocketAppender">
               <param name="remoteHost"     value="${org.apache.accumulo.core.host.log}"/>
               <param name="port"           value="${org.apache.accumulo.core.host.log.port}"/>
               <param name="application"    value="${org.apache.accumulo.core.application}:${org.apache.accumulo.core.ip.localhost.hostname}"/>
               <param name="Threshold"      value="WARN"/>
            </appender>
            <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
               <appender-ref ref="N1" />
            </appender>
          

          Here is an updated configuration using AsyncSocketAppender.

          <appender name="ASYNC" class="org.apache.accumulo.core.util.AsyncSocketAppender">
               <param name="remoteHost"     value="${org.apache.accumulo.core.host.log}"/>
               <param name="port"           value="${org.apache.accumulo.core.host.log.port}"/>
               <param name="application"    value="${org.apache.accumulo.core.application}:${org.apache.accumulo.core.ip.localhost.hostname}"/>
               <param name="Threshold"      value="WARN"/>
            </appender>
          

          The same parameters passed to the stock socket appender can be passed to AsyncSocketAppender. Specifically, the logging-related system properties set in Accumulo.init() are used in the same way to the same effect; this is because the new appender merely embeds a socket appender and supports its parameters, passing through to it.

          The main purpose of this ticket is to allow configuring Log4J via a properties file. Except for that specific purpose, there is really no compelling reason to switch from the stock appenders. Example Log4J XML files can remain as they are, and there would be no point in changing deployed Log4J XML files in 1.6.0 deployments.

          Show
          Bill Havanki added a comment - To make this more concrete: Here is a current example configuration using the separate, stock AsyncAppender and SocketAppender . <appender name= "N1" class= "org.apache.log4j.net.SocketAppender" > <param name= "remoteHost" value= "${org.apache.accumulo.core.host.log}" /> <param name= "port" value= "${org.apache.accumulo.core.host.log.port}" /> <param name= "application" value= "${org.apache.accumulo.core.application}:${org.apache.accumulo.core.ip.localhost.hostname}" /> <param name= "Threshold" value= "WARN" /> </appender> <appender name= "ASYNC" class= "org.apache.log4j.AsyncAppender" > <appender-ref ref= "N1" /> </appender> Here is an updated configuration using AsyncSocketAppender . <appender name= "ASYNC" class= "org.apache.accumulo.core.util.AsyncSocketAppender" > <param name= "remoteHost" value= "${org.apache.accumulo.core.host.log}" /> <param name= "port" value= "${org.apache.accumulo.core.host.log.port}" /> <param name= "application" value= "${org.apache.accumulo.core.application}:${org.apache.accumulo.core.ip.localhost.hostname}" /> <param name= "Threshold" value= "WARN" /> </appender> The same parameters passed to the stock socket appender can be passed to AsyncSocketAppender . Specifically, the logging-related system properties set in Accumulo.init() are used in the same way to the same effect; this is because the new appender merely embeds a socket appender and supports its parameters, passing through to it. The main purpose of this ticket is to allow configuring Log4J via a properties file. Except for that specific purpose, there is really no compelling reason to switch from the stock appenders. Example Log4J XML files can remain as they are, and there would be no point in changing deployed Log4J XML files in 1.6.0 deployments.
          Hide
          ASF subversion and git services added a comment -

          Commit 5a72c37eadeca58e670517611f39824f4307321e in accumulo's branch refs/heads/1.6.1-SNAPSHOT from Bill Havanki
          [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=5a72c37 ]

          ACCUMULO-2343 Add AsyncSocketAppender

          AsyncSocketAppender is a Log4J AsyncAppender with its own internal SocketAppender.
          Configuration for either appender can be set on the AsyncSocketAppender itself. An
          AsyncSocketAppender can be configured using a Log4J properties file, while an ordinary
          AsyncAppender cannot.

          Show
          ASF subversion and git services added a comment - Commit 5a72c37eadeca58e670517611f39824f4307321e in accumulo's branch refs/heads/1.6.1-SNAPSHOT from Bill Havanki [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=5a72c37 ] ACCUMULO-2343 Add AsyncSocketAppender AsyncSocketAppender is a Log4J AsyncAppender with its own internal SocketAppender. Configuration for either appender can be set on the AsyncSocketAppender itself. An AsyncSocketAppender can be configured using a Log4J properties file, while an ordinary AsyncAppender cannot.
          Hide
          ASF subversion and git services added a comment -

          Commit 5a72c37eadeca58e670517611f39824f4307321e in accumulo's branch refs/heads/master from Bill Havanki
          [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=5a72c37 ]

          ACCUMULO-2343 Add AsyncSocketAppender

          AsyncSocketAppender is a Log4J AsyncAppender with its own internal SocketAppender.
          Configuration for either appender can be set on the AsyncSocketAppender itself. An
          AsyncSocketAppender can be configured using a Log4J properties file, while an ordinary
          AsyncAppender cannot.

          Show
          ASF subversion and git services added a comment - Commit 5a72c37eadeca58e670517611f39824f4307321e in accumulo's branch refs/heads/master from Bill Havanki [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=5a72c37 ] ACCUMULO-2343 Add AsyncSocketAppender AsyncSocketAppender is a Log4J AsyncAppender with its own internal SocketAppender. Configuration for either appender can be set on the AsyncSocketAppender itself. An AsyncSocketAppender can be configured using a Log4J properties file, while an ordinary AsyncAppender cannot.

            People

            • Assignee:
              Bill Havanki
              Reporter:
              Josh Elser
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development