Yes, if the event property is log.level (you can find it in Kibana for instance). I think it's actually log.level with Log4j2 (loggerLevel is with Log4j1 afair).
Does it work like this ? Regards JB On 08/07/2019 14:21, Markus Rathgeb wrote: > After reading the code of > org.apache.karaf.decanter.alerting.checker.Checker I realized that the > checker configuration needs to be equal to: > > === > log.level.error=match:ERROR > log.level.warn=match:WARN > === > > Am Mo., 8. Juli 2019 um 14:10 Uhr schrieb Jean-Baptiste Onofré > <[email protected]>: >> >> Let me try to reproduce on my machine. Give me couple of hours, I will >> get back to you. >> >> Regards >> JB >> >> On 08/07/2019 13:51, Markus Rathgeb wrote: >>> Hi, >>> >>> I would like to setup a Karaf based system to send mails for log >>> messages of priority WARN and ERROR. >>> >>> I read some of the "Apache Karaf Decanter 2.x" documentation. >>> >>> $ tar xzf apache-karaf-4.2.6.tar.gz >>> $ cd apache-karaf-4.2.6/ >>> $ bin/karaf >>> >>> karaf@root()> feature:repo-add >>> mvn:org.apache.karaf.decanter/apache-karaf-decanter/2.0.0/xml/features >>> karaf@root()> feature:install decanter-collector-log >>> karaf@root()> feature:install decanter-alerting-email >>> >>> There are now three configuration files: >>> * org.apache.karaf.decanter.alerting.checker.cfg >>> * org.apache.karaf.decanter.alerting.email.cfg >>> * org.apache.karaf.decanter.collector.log.cfg >>> >>> Edit "org.apache.karaf.decanter.alerting.checker.cfg" and add that lines: >>> === >>> loggerLevel.error=match:ERROR >>> loggerLevel.warn=match:WARN >>> === >>> >>> Add the mail setup to "org.apache.karaf.decanter.alerting.email.cfg". >>> >>> Keep the standard "org.apache.karaf.decanter.collector.log.cfg". >>> >>> Let's trigger an ERROR log by trigger a feature installation of an non >>> existing one: >>> karaf@root()> feature:install unknown-feature-name >>> >>> The error contains that message: >>> === >>> 13:40:55.830 ERROR [Karaf local console user karaf] Exception caught >>> while executing command >>> java.lang.IllegalArgumentException: No matching features for >>> unknown-feature-name/0 >>> at >>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.computeFeaturesToAdd(FeaturesServiceImpl.java:835) >>> ~[?:?] >>> at >>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:798) >>> ~[?:?] >>> at >>> org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:78) >>> ~[?:?] >>> at >>> org.apache.karaf.features.command.FeaturesCommandSupport.execute(FeaturesCommandSupport.java:40) >>> ~[?:?] >>> at >>> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) >>> ~[?:?] >>> at >>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) >>> ~[?:?] >>> at >>> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) >>> ~[?:?] >>> at >>> org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) >>> ~[?:?] >>> at >>> org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) >>> ~[?:?] >>> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) >>> ~[?:?] >>> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?] >>> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?] >>> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?] >>> at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?] >>> at >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >>> ~[?:?] >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >>> ~[?:?] >>> at java.lang.Thread.run(Thread.java:748) [?:?] >>> === >>> >>> I would expect to receive a mail message now. >>> >>> No mail has been received. >>> >>> If I try to use the TRACE level for the decanter package space to >>> "see" what's going on >>> karaf@root()> log:set TRACE org.apache.karaf.decanter >>> >>> I get the additional log message: >>> === >>> 2019-07-08 13:48:55,021 Karaf local console user karaf ERROR Recursive >>> call to appender PaxOsgi >>> === >>> >>> So, I assume I need to use a debugger to get further information what >>> is going on / wrong. >>> >>> Any other suggestions? >>> >> >> -- >> Jean-Baptiste Onofré >> [email protected] >> http://blog.nanthrax.net >> Talend - http://www.talend.com -- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
