Page 1 of 1

Audit log in livecode server

Posted: Wed Dec 12, 2018 3:56 pm
by terryho
Hi All,

Can anyone can point me the way to write a audit log in livecode server which host in hostm.com ?

I try to use the following method, but I don't know where is the correct path to save the file and don't know whether it is work or not.

function httpsapi.init
addlog($_post_raw)
end httpsapi.init

on addlog prequest
put "some data" into url "file:../hostname.com/textfile.txt" // which is failed
put specialfolderpath("Temporary") & "textfile.txt" into alogfile
open file alogfile for append
wirte the english date & tab & preuest & return to file alogfile
close file alogfile
end addlog

Regards

Terry Ho

Re: Audit log in livecode server

Posted: Wed Dec 12, 2018 6:30 pm
by FourthWorld
The best place to write logs will be determined by what is reading them. How will you retrieve the logs, how frequently, and how will they be used?

Re: Audit log in livecode server

Posted: Thu Dec 13, 2018 8:45 am
by terryho
Hi,

What I want to do is for two purpose:

1. Debug purpose, want to know what data is receive and send out.

2. For long term, it may create a audit log to know where is the request from, what they request or if discover has illegal activity, it may block the ip or info the web admin and etc.

Regards

Terry Ho

Re: Audit log in livecode server

Posted: Fri Dec 14, 2018 11:18 pm
by FourthWorld
Shared host:
Any folder in your home folder, above your web root.

Dedicated/VPS:
/var/log/ is the standard place for logs. You could create a folder there, and assign a group with write permissions to it, and set permissions for your process as a member of that group.

Re: Audit log in livecode server

Posted: Mon Dec 17, 2018 3:57 am
by terryho
Hi ,

Thanks your help. I find the way to make it, which is use the current stack path.

Regards

Terry Ho