https://kotlinlang.org logo
#server
Title
# server
h

Hildebrandt Tobias

02/28/2024, 4:49 PM
Hi, can someone recommend an audit library? In terms of recording who did what and when? Still contemplating if I write my own mini solution or use something existing.
c

CLOVIS

02/29/2024, 4:58 PM
What do you want to record? Actions end users do when interacting with your system? How do you want to record that? Log files, a database somewhere?
h

Hildebrandt Tobias

03/01/2024, 6:50 PM
Hey, yes. Essentially I just want to record when Person A changed the config of Device B on the 55th of March at 25:40. And other small stuff like that.
c

CLOVIS

03/02/2024, 11:05 AM
If you're using Ktor, you can add the username in log lines like this: https://ktor.io/docs/call-logging.html#mdc
h

Hildebrandt Tobias

03/02/2024, 2:51 PM
Ah, good to know. We don't use Ktor, also I need the audit in the database and not just logs because it needs to be added as a history to the bottom of most pages, as well as a browsable overall table. I guess I'll just abstract the database call and write the audit entries alongside it or something simple like this.
👍 1
c

CLOVIS

03/02/2024, 3:03 PM
Also, just in case, the GDPR doesn't really like these kinds of features, so maybe check with your local expert with your exact situation
h

Hildebrandt Tobias

03/02/2024, 3:57 PM
Ha! Good call actually. I gonna look into it.
3 Views