Audit log in livecode server

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
terryho
Posts: 84
Joined: Mon Nov 05, 2012 2:53 pm

Audit log in livecode server

Post by terryho » Wed Dec 12, 2018 3:56 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6597
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Audit log in livecode server

Post by FourthWorld » Wed Dec 12, 2018 6:30 pm

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?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

terryho
Posts: 84
Joined: Mon Nov 05, 2012 2:53 pm

Re: Audit log in livecode server

Post by terryho » Thu Dec 13, 2018 8:45 am

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6597
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Audit log in livecode server

Post by FourthWorld » Fri Dec 14, 2018 11:18 pm

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.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

terryho
Posts: 84
Joined: Mon Nov 05, 2012 2:53 pm

Re: Audit log in livecode server

Post by terryho » Mon Dec 17, 2018 3:57 am

Hi ,

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

Regards

Terry Ho

Post Reply

Return to “CGIs and the Server”