Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-764

Log CURL requests to database table instead of file

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.2.0-B1
    • Component/s: Database
    • Labels:
    • Additional information:
      Hide

      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)

      Show
      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)
    • Change Log Message:
      Move CURL logs into database
    • Story Points:
      1
    • External issue ID:
      950
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

    • BC Break Details:
      Hide

      Renamed methods:

      • "kCurlHelper::isGoodResponceCode" into "kCurlHelper::isGoodResponseCode" (type in method name fixed)
      Show
      Renamed methods: "kCurlHelper::isGoodResponceCode" into "kCurlHelper::isGoodResponseCode" (type in method name fixed)

      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`)
      );

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Erik Snarski [Intechnic]
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: