[tor-bugs] #20128 [Metrics/CollecTor]: CollecTor log to mail-appender

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Sep 10 18:41:24 UTC 2016


#20128: CollecTor log to mail-appender
-----------------------------------+-----------------
     Reporter:  iwakeh             |      Owner:
         Type:  enhancement        |     Status:  new
     Priority:  Medium             |  Milestone:
    Component:  Metrics/CollecTor  |    Version:
     Severity:  Normal             |   Keywords:
Actual Points:                     |  Parent ID:
       Points:                     |   Reviewer:
      Sponsor:                     |
-----------------------------------+-----------------
 Use logbacks mail-appender for mailing ERROR level mails.
 I don't want to "hide" the configuration in a wiki page, but it should not
 be part of the default log configuration.
 Where should it go?
 Commented in the default logback.xml or ... ?

 === Simple setup
 The following is the minimal setup that works for me, see
 [http://logback.qos.ch/manual/appenders.html#SMTPAppender logback
 documentation] for more parameters.

 * This appender needs to be added to logback.xml
 {{{
   <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
     <smtpHost>smtphost.org</smtpHost>
     <to>the at email.somewhere</to>
     <subject>%logger{20} - %m</subject>
     <layout class="ch.qos.logback.classic.html.HTMLLayout"/>

     <cyclicBufferTracker
 class="ch.qos.logback.core.spi.CyclicBufferTracker">
       <!-- send immediately, if an ERROR occurs -->
       <bufferSize>1</bufferSize>
     </cyclicBufferTracker>
   </appender>
 }}}

 * and this `<appender-ref ref="EMAIL" />` to the root-element.
 * In addition the gnu-mail jars (available in debian) have to be added to
 the classpath, i.e. `/usr/share/java/gnumail.jar:/usr/share/java/gnumail-
 providers.jar`.

 The logback appender only mails in case of /errors/. Anything different
 needs an implementation of `EventEvaluator` (cf.
 [http://logback.qos.ch/manual/appenders.html#TriggeringEvent logback
 documentation]).

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20128>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list