Qlik Community

Ask a Question

Qlik Architecture Deep Dive Blog

Deep dives into specific back-end technologies which allow for the extension of Qlik to fit the needs of the enterprise.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
Levi_Turner
Employee
Employee

Using Apache Log4Net to receive email notification for reload failures

This is a more in-depth post as a follow up to the overview post: Getting Notified from Qlik Sense

smtp appender

The smtp appender is an appender type provided by the Apache Log4Net library which Qlik Sense uses. At its core, the configuration of this appender will require:

  • smtp server details
  • A logger from Qlik Sense to attach in order to trigger email alerts

The smtp server configuration can vary between email providers, but examples are provide in this Github Repository.

For the logger details, an excerpted config may look as follows:

...
        <layout type="log4net.Layout.PatternLayout">
            <param name="conversionPattern" value="Date: %date %newlineTask Name: %property{TaskName}%newlineAppName:%property{AppName}%newlineError Message: %message%newline%newline%newline" />
...
    <logger name="System.Scheduler.Scheduler.Slave.Tasks.ReloadTask">
        <appender-ref ref="MailAppender" />
    </logger>

...

To explain the mapping refer to this Qlik Sense Scheduler log:

scheduler-log.png

 

In the <layout> tag, we are using % to provide variables which are taken from the header of the log file

XML Element Sense Log / Cell Value
<layout> %property{TaskName} M1
<layout> %property{AppName} Q1
<logger> E6

An example email alert from using this method:

notified_2.png

 

21 Comments
balaji_MAC
Contributor III
Contributor III

Hi Levi,

thansk for sharing this article.

we have placed this file LocalLogConfig.xml file in the below path.

To configure Qlik Sense to use an appender, a configuration file, LocalLogConfig.xml must be created in the %ProgramData%\Qlik\Sense\<service> folder.

we have placed this file in the proxy node.

do we need to do any other configuration and we want to know how to test this activity.

Regards,

balaji

0 Likes
2,515 Views
Levi_Turner
Employee
Employee

@balaji_MAC : I do not follow. What are  you trying to use Log4Net for?

Broadly the steps are:

  • Place the XML into the service directory for the service who does the logging that you're interested in
  • Ensure that the XML has appropriate authentication settings
  • Figure out which logger you want to monitor
  • Success

Practically, I like to test Log4Net using the UDP appender since it will go locally to a module that I am running.

0 Likes
2,502 Views
balaji_MAC
Contributor III
Contributor III

Hi Levi,

Hope you are doing well.

Apologies for the delay.

i tried to implement this solution but i couldn't able to achieve it.

do we any document or gudiance to implement this solution.

i have few open questions.

Current issue:

1.Do we need to install log4net or any other configration?

2.we couldn't able to find below path in our Qlik environement.

LocalLogConfig.xmlLog4Net\udp\qpsLog4Net udp Appender for notification of Qlik Sense Proxy Sessions
LocalLogConfig.xmlLog4Net\udp\qssLog4Net udp Appender for notification of email failures

 

3.we are in the process to implement qlik task failure auto email notifcation.

Thanks in advance.

Regards,

Balaji

0 Likes
2,472 Views
balaji_MAC
Contributor III
Contributor III

Hi Levi,

Hope you are doing well.

Can you please let us know yoru input on the above request.

Regards,

balaji

0 Likes
2,462 Views
Levi_Turner
Employee
Employee

> Do we need to install log4net or any other configration?

No. Just place a properly configured XML file into the appropriate service directory (%ProgramData%\Qlik\Sense\<Service>, e.g. %ProgramData%\Qlik\Sense\Scheduler).

 

> 2.we couldn't able to find below path in our Qlik environement.

Those are just the structure of how I stored things in GitHub, see above.

2,438 Views
balaji_MAC
Contributor III
Contributor III

Hi Levi,

Thanks for your update.

we have placed file in the right path and reloaded Qlik task but we didn't get any email notification.

Do we need to do any other configuration to get task failure notification.

https://www.youtube.com/watch?v=dnDqzN8pj70

i have gone through above video and you ran some node js.Kindly guide us to implement this solution.

Appreciate you support.

Regards,

Balaji

0 Likes
2,427 Views