Use "System Log" to log HTTP requests

1 view
Skip to first unread message

Alexander Obuhovich

unread,
Jan 8, 2013, 9:10:44 AM1/8/13
to Development In-Portal
In-Portal has a functionality to log all incoming HTTP requests.

Logging can be enabled by specifying path to log file in DBG_REQUREST_LOG constant in /system/debug.php

After using this functionality for a while here are few things I've noticed:

Pros:
  • GET/POST/COOKIE is recorded
  • some other information to identify user, who made a request is recorded
Cons:
  • hard to analyze, because in a result a large text file is created
  • HTTP headers not recorded

Gladly in http://tracker.in-portal.org/view.php?id=1003 task (In-Portal 5.2.1-B1) we've create flexible logging engine that logs same information but in easily browsable/searchable form.


I recommend to use this "System Log" section to log all information. But we also need to improve "System Log" section by adding ability to log HTTP headers along with HTTP requests.



--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Jan 9, 2013, 11:10:06 AM1/9/13
to Development In-Portal
Also to enable advanced log behind what to log and what not to log I'm proposing to move actual logging code ($this->Application->log method call) to an "adm:OnLogHttpRequest" event.

This way developers can extend AdminEventHandler class and write necessary logic over existing adm:OnLogHttpRequest.

That event in turn will be called from existing code based on whatever DBG_REQUREST_LOG constant is turned on.


Also I belive, that current decision not to log requests from non logged-in users made in kApplication class should be moved into new "adm:OnLogHttpRequest" event.

Reply all
Reply to author
Forward
0 new messages