cómo filtrar errores y excepciones de un tipo particular en el agregador de correo electrónico smtp utilizado en logback.xml

i am new to smtp email appender.i have a logback.xml file with the below shown content in the classpath of a project. i have configured it like this

<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
    <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator">

    <to>*********</to> <!-- additional destinations are possible -->
    <subject>TESTING ERRORS FROM WEB </subject>
    <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
  <layout class="ch.qos.logback.classic.PatternLayout">
      <pattern>%date %-5level %logger{35} - %message%n</pattern>

  <logger name="emailappender" level="INFO"/>

  <root level="warn">
    <appender-ref ref="STDOUT" />
    <appender-ref ref="MAIN_FILE_APPENDER" />
    <appender-ref ref="EMAIL" />

the purpose of sending emails is satisfied but it is sending for all kinds of exceptions and errors encountered. can we configure this in a way that we can send emails for only some kinds of errors and exceptions(like filtering on some basis). Could anyone please help me with the xml code to be modified here.

preguntado el 27 de noviembre de 13 a las 05:11

1 Respuestas

To control spam you can use the new Whisper appender as described aquí.

Statutory disclaimer: I'm the author of Whisper.

Respondido el 14 de enero de 14 a las 17:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.