Logic Machine Forum
How to read access log from script? - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: How to read access log from script? (/showthread.php?tid=854)



How to read access log from script? - Mirco - 21.06.2017

Hi, how can I read access log from a script?
Thanks


RE: How to read access log from script? - admin - 21.06.2017

Code:
items = db:getall('SELECT * FROM user_logs ORDER BY id DESC')

for _, item in ipairs(items) do
  login = item.login
  ip = item.ip
  date = os.date('%c', item.created)

  log(login, ip, date)
end



RE: How to read access log from script? - Mirco - 22.06.2017

Thanks! Smile