Hi Markus,

you can see the alert using decanter:alert command.

In the case of log, it's a bit special: you receive an alert as soon as
you have a log.level in WARN, and it's stored in the Decanter alerts.
Then, the next log message which is not a WARN will notify you.

I need to improve a bit the mail alerter to only send the first email in
the case of log (it makes sense for metrics, like the ones coming from
the JMX collector).

Regards
JB

On 08/07/2019 14:38, Markus Rathgeb wrote:
> The mails content does not seem to be fully correct.
> 
> There is e.g. a mail with subject: Alert on level back to normal
> and body:
> ===
> warn alert: level was out of the pattern match:WARN, but back to normal now
> 
> Details:
>         hostName: pc05
>         alertPattern: match:WARN
>         component.name: org.apache.karaf.decanter.collector.log
>         loc.class: ...
>         level: WARN
>         alertLevel: warn
>         type: log
>         message: no feature found for class: class ...
>         MDC: {bundle.version=..., bundle.name=..., bundle.id=22}
>         threadName: ...
>         loc.method: ...
>         loc.file: ...java
>         component.id: 43
>         alertBackToNormal: true
>         karafName: root
>         name: log
>         org.ops4j.pax.logging.appender.name: DecanterLogCollectorAppender
>         hostAddress: 127.0.0.1
>         loggerName: ...
>         loggerClass: org.ops4j.pax.logging.slf4j.Slf4jLogger
>         renderedMessage: no feature found for class: class ...
>         alertAttribute: level
>         timestamp: 1562588565010
>         loc.line: 125
>         event.topics: decanter/alert/warn
> ===
> 
> and another one with subject: [warn] Alert on level
> and body
> ===
> warn alert: level is out of the pattern match:WARN
> 
> Details:
>         hostName: pc05
>         alertPattern: match:WARN
>         component.name: org.apache.karaf.decanter.collector.log
>         loc.class: ...
>         level: INFO
>         alertLevel: warn
>         type: log
>         message: dropped already queued function for ...
>         MDC: {bundle.version=..., bundle.name=..., bundle.id=22}
>         threadName: ...
>         loc.method: ...
>         loc.file: ....java
>         component.id: 43
>         alertBackToNormal: false
>         karafName: root
>         name: log
>         org.ops4j.pax.logging.appender.name: DecanterLogCollectorAppender
>         hostAddress: 127.0.0.1
>         loggerName: ...
>         loggerClass: org.ops4j.pax.logging.slf4j.Slf4jLogger
>         renderedMessage: dropped already queued function for ...
>         alertAttribute: level
>         timestamp: 1562588567267
>         loc.line: 56
>         event.topics: decanter/alert/warn
> ===
> 
> I would expect the opposite.
> If "level: WARN" I would expect the subject "[warn] Alert on level"
> and if level is not WARN an subject of "Alert on level back to normal"
> 
> Or is my understanding wrong here?
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to