NTT DATA Business Solutions
Torben Seebach | maj 9, 2018 | 3 min.

QuickGuide: get email-notifications when tasks fail - Qlik Sense

 

When a task fails, you really would love to receive a notification in your inbox so you can quickly fix the problem.

digital strategy

When a task fails, you really would love to receive an email notification in your inbox so you can quickly fix the problem. Using the Operations Monitor is not the ideal solution. In QlikView there’s a QMC setting that enables all failed tasks to send an email alert. In Qlik Sense this feature is oddly enough missing. But it’s actually super simple to enable. The only thing you need is to add an xml file that configures the Log4net framework to send email alerts. Here’s a step by step guide:

  1. Get the following info:
    1. SMTP Server name
    2. Username/Password
    3. Port and TLS setting
    4. Alert Recipients Emails Addresses
  2. Create a new xml file in %ProgramData%\Qlik\Sense\Scheduler called LocalLogConfig.xml and copy the code below
  3. Edit the following all highlighted code according to point 1, save and restart your Qlik Sense services:
<?xml version=”1.0″?>
<configuration>
<!– Mail appender–>
<appender name=”MailAppender” type=”log4net.Appender.SmtpAppender”>
<filter type=”log4net.Filter.LevelRangeFilter”>
<param name=”levelMin” value=”ERROR” />
</filter>
<filter type=”log4net.Filter.DenyAllFilter” />
<evaluator type=”log4net.Core.LevelEvaluator”>
<param name=”threshold” value=”ERROR”/>
</evaluator>
<param name=”to” value=”[email protected]” />
<param name=”from” value=”[email protected]” />
<param name=”subject” value=”Qlik Sense Task Alert” />
<param name=”smtpHost” value=”smtp.domain.com” />
<param name=”port” value=”25” /><!– 25, 465, 567  –>
<param name=”EnableSsl” value=”false” /> <!– True False –>
<param name=”Authentication” value=”none” />  <!– None Basic NTML –>
<param name=”username” value=”yourloging” />
<param name=”password” value=”yourpassword” />
<param name=”bufferSize” value=”0″ /> <!– Set this to 0 to make sure an email is sent on every error –>
<param name=”lossy” value=”true” />
<layout type=”log4net.Layout.PatternLayout”>
<param name=”conversionPattern” value=”The Task ‘%property{TaskName}’ failed at %date with the Errorlevel ‘%-5level’ %newline%newlineThe App Name is ‘%property{AppName}’ %newline%newlineThe Message was ‘%message’ %newline%newline%newline” />
</layout>
</appender> <!–Send mail on task failure–>
<logger name=”System.Scheduler.Scheduler.Slave.Tasks.ReloadTask”>
<appender-ref ref=”MailAppender” />
</logger>
</configuration>

If you’re running a cluster, then you need to add this file to any node that reloads apps.

Enjoy your email notifications!