In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Type Reproducibility Date Submitted Last Update
0000950 [In-Portal CMS] Database task always 2010-12-13 12:35 2012-07-25 05:33
Reporter alex View Status public Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.2.0-B1
Status closed Product Version 5.1.1 Target Version 5.2.0
Time EstimateNo estimate
Summary 0000950: Log CURL requests to database table instead of file
Description Curl helper has nice logging feature, that allows to trace all curl requests made over time.

Problem is, that it's not very easy to handle such amount of information, when it is written into a single file. Also when website has large amount of concurrent curl requests, then curl request data is all mixed up together and there is no way to detect what actually happens.

To solve it I propose to log curl requests to database.

Here is table structure, that I've used:


CREATE TABLE IF NOT EXISTS `ptn_CurlLog` (
  `LogId` int(11) NOT NULL AUTO_INCREMENT,
  `Message` varchar(255) NOT NULL,
  `PageUrl` varchar(255) NOT NULL,
  `RequestUrl` varchar(255) NOT NULL,
  `PortalUserId` int(11) NOT NULL,
  `SessionKey` int(11) NOT NULL,
  `IsAdmin` tinyint(4) NOT NULL,
  `PageData` text,
  `RequestData` text,
  `ResponseData` text,
  `RequestDate` int(11) DEFAULT NULL,
  `ResponseDate` int(11) DEFAULT NULL,
  `ResponseHttpCode` int(11) NOT NULL,
  `CurlError` varchar(255) NOT NULL,
  PRIMARY KEY (`LogId`),
  KEY `Message` (`Message`),
  KEY `PageUrl` (`PageUrl`),
  KEY `RequestUrl` (`RequestUrl`),
  KEY `PortalUserId` (`PortalUserId`),
  KEY `SessionKey` (`SessionKey`),
  KEY `IsAdmin` (`IsAdmin`),
  KEY `RequestDate` (`RequestDate`),
  KEY `ResponseDate` (`ResponseDate`),
  KEY `ResponseHttpCode` (`ResponseHttpCode`),
  KEY `CurlError` (`CurlError`)
);
Additional Information Plan:
1. create CurlLog table and put it into install/upgrade script
2. incorporate changes made in e_curl_helper.php file into kCurlHelper class
3. make sure, that calls to kCurlHelper class still works (where they are made)
4. try enabling curl request logging and verify that all needed data is written into CurlLog table
5. no need for any grid in Admin Console, since we will be looking into database directly to read logs (if there is a need)
Tags No tags attached.
Reference http://groups.google.com/group/in-portal-bugs/browse_thread/thread/39e40338b4bf3221
Change Log Message Move CURL logs into database
Estimate Points 1
Attached Files ? file icon e_curl_helper.php [^] (4,094 bytes) 2010-12-13 12:35
patch file icon log_curl_requests_950.patch [^] (6,550 bytes) 2011-10-17 06:28 [Show Content]
patch file icon log_curl_requests_950.2.patch [^] (6,838 bytes) 2011-10-17 12:04 [Show Content]
patch file icon curl_request_db_logging_v3.patch [^] (11,239 bytes) 2011-10-18 04:03 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to 0000954closed (5.1.3)alex Warning about missing $_SERVER['REQUEST_URI'], while working from PHP CLI 
related to 0001201closed (5.2.0)alex Fatal error during Installation on States import with MySQL in Strict Mode 

-  Notes
User avatar (0004056)
erik (manager)
2011-10-17 06:30

patch attached - needs testing
User avatar (0004059)
alex (manager)
2011-10-17 09:40

1. Comment of kCurlHelper::Send method doesn't match method declaration.

2. Since 5.2.0 release should as close to PHP5 as possible, then all added code must have scope operators present, e.g. private/public/protected.

3. Column RequestData in CurlLog table is always empty.
User avatar (0004065)
erik (manager)
2011-10-17 12:08

1) added description of 2 parameters to Send method declaration
2) added scope operator to logId property
3) fixed property name to write into RequestData column

log_curl_requests_950.2.patch attached - needs testing
User avatar (0004067)
alex (manager)
2011-10-18 04:05

Tested.

I've fixed:
1. table CurlLog wasn't listed in core/install/remove_schema.sql file

I've changed:
1. added DBG_CURL constant usage sample into tools/debug_sample.php file
2. spelling fixes in method comments & method names
User avatar (0004068)
alex (manager)
2011-10-18 04:06

Fix committed to 5.2.x branch. Commit Message:

Fixes 0000950: Log CURL requests to database table instead of file
Commit on behalf of Erik
User avatar (0005117)
alex (manager)
2012-07-25 05:33

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r14671
Timestamp: 2011-10-18 04:06:08
Author: alex
Details ] Diff ]
Fixes 0000950: Log CURL requests to database table instead of file
Commit on behalf of Erik
mod - /in-portal/branches/5.2.x/core/install/install_schema.sql Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install/remove_schema.sql Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install/upgrades.sql Diff ] File ]
mod - /in-portal/branches/5.2.x/core/install.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/helpers/curl_helper.php Diff ] File ]
mod - /in-portal/branches/5.2.x/tools/debug_sample.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-07-25 05:33 alex Note Added: 0005117
2012-07-25 05:33 alex Status resolved => closed
2012-02-06 04:09 alex Relationship added related to 0001201
2011-10-22 05:26 alex Estimate Points => 1
2011-10-18 04:06 alex Changeset attached 5.2.x r14671
2011-10-18 04:06 alex Note Added: 0004068
2011-10-18 04:06 alex Status reviewed and tested => resolved
2011-10-18 04:06 alex Fixed in Version => 5.2.0-B1
2011-10-18 04:06 alex Resolution open => fixed
2011-10-18 04:06 alex Assigned To !COMMUNITY => alex
2011-10-18 04:05 alex Note Added: 0004067
2011-10-18 04:05 alex Assigned To alex => !COMMUNITY
2011-10-18 04:05 alex Status needs testing => reviewed and tested
2011-10-18 04:03 alex File Added: curl_request_db_logging_v3.patch
2011-10-17 12:08 erik Note Added: 0004065
2011-10-17 12:08 erik Assigned To erik => alex
2011-10-17 12:08 erik Status needs work => needs testing
2011-10-17 12:04 erik File Added: log_curl_requests_950.2.patch
2011-10-17 09:40 alex Note Added: 0004059
2011-10-17 09:40 alex Assigned To alex => erik
2011-10-17 09:40 alex Status needs testing => needs work
2011-10-17 06:30 erik Time Estimate Removed 2 =>
2011-10-17 06:30 erik Note Added: 0004056
2011-10-17 06:30 erik Assigned To erik => alex
2011-10-17 06:30 erik Developer => erik
2011-10-17 06:30 erik Status needs work => needs testing
2011-10-17 06:28 erik File Added: log_curl_requests_950.patch
2011-10-14 02:44 alex Reporter erik => alex
2011-10-14 02:44 alex Assigned To => erik
2011-10-14 02:44 alex Status active => needs work
2011-10-14 02:34 alex Reporter alex => erik
2011-10-14 02:34 alex Additional Information Updated View Revisions
2011-09-27 06:27 alex Time Estimate Added 2
2011-09-23 21:28 Dmitry Target Version Icebox => 5.2.0
2010-12-27 08:13 alex Relationship added related to 0000954
2010-12-13 12:35 alex New Issue
2010-12-13 12:35 alex File Added: e_curl_helper.php
2010-12-13 12:35 alex Reference => http://groups.google.com/group/in-portal-bugs/browse_thread/thread/39e40338b4bf3221
2010-12-13 12:35 alex Change Log Message => Move CURL logs into database



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker