Skip to main content
January 11, 2021
Question

Need to log user logins from multiple application servers

  • January 11, 2021
  • 3 replies
  • 0 views

Team,

I am using readcsvlog plugin to read login audit.csv and then writing to database.

PROD we have two application severs and sometime it is reading from a file which have less logins . I want it to read it from both application sever .

Below is the code. In CSV path i want to pass location of application sever instead of checking at /logs. Any idea?

readcsvlog(
csvPath: "login-audit.csv."& text(today()-ri!number,"yyyy-mm-dd"),
startIndex: 1,
batchSize: - 1
),

3 replies

January 11, 2021

Hi,
as a best practice I would avoid having server specific code in an application. If you are on premise you can solve this at server level. Implementing a cron job which copies and combines the content of both files into one with specific name once per day. With the readcsvlog plugin you can read this file
and fetch the content. As the documentation of the plugin states - you have to make sure the file you are going to read resides in the log\ directory.

January 12, 2021

Thank you , got it. But on which app server to store it , both ?

January 12, 2021

Only one of the app servers. Which app server you choose is up to you. Important is to define a symbolic link that you can read from "/opt/appian/shared-logs/login-audit.csv" and the code is free from server references.
Symlinks in Unix: www.freecodecamp.org/.../