Help Docs

CodeIgniter Logs

CodeIgniter is a powerful, secure, lightweight PHP framework. By default, CodeIgniter displays all PHP errors and lets you log your error messages. You can track and monitor these logs with Site24x7 Applogs.

This document will explain how to monitor CodeIgniter logs.

Instructions:

  1. Log in to your Site24x7 account.
  2. Download and install the Site24x7 Server Monitoring agent (Windows | Linux).
  3. Go to Admin > AppLogs > Log Profile and select Add Log Profile.
  4. Enter the Profile Name.
  5. For Choose the Log Type, select CodeIgniter Logs from the drop-down list.
    • The Pattern and Sample Logs are displayed below. By default, this is the log pattern identified by Site24x7 AppLogs for CodeIgniter logs:
      $LogLevel$ - $Datetime:date$ --> !Severity: $Severity$ --> !$Message$
      Sample Logs:

      ERROR - 2018-06-19 13:41:16 --> Severity: Warning --> Missing argument 2 for CropAvatar::__construct(), called in
      /var/www/planaday.nl/prod/repo/2.4.3/CodeIgniter/system/core/Loader.php on line 1275 and defined
      /var/www/planaday.nl/prod/repo/2.4.3/application/libraries/CropAvatar.php 16

      ERROR - 2018-06-19 13:41:16 --> Severity: Warning --> Missing argument 3 for CropAvatar::__construct(), called in
      /var/www/planaday.nl/prod/repo/2.4.3/CodeIgniter/system/core/Loader.php on line 1275 and defined
      /var/www/planaday.nl/prod/repo/2.4.3/application/libraries/CropAvatar.php 16

      ERROR - 2018-06-19 14:14:48 --> Severity: Warning --> Invalid argument supplied for foreach()
      /var/www/planaday.nl/prod/repo/2.4.3/application/controllers/api/v1/private/company/Generic_Get.php 98

      This log is separated into fields, each of which takes its respective value and is then uploaded to Site24x7.
    • You can also add a custom log pattern instead of the default one. To do so, click the pencil icon and specify your pattern. Additionally, provide three examples for us to understand and query your custom log pattern.
  6. Select the Log Source. By default, the paths below are used as a file source:
    Linux: "/var/www/html/*/prod/logs/*.log",
    "/var/www/html/*/writeable/logs/*.log"
  7. If your source path is different from the default path, specify it while adding the log profile.
  8. You can also associate this log profile with monitors, monitor groups, or corresponding servers. Learn more.
  9. Click Save.

Was this document helpful?

Shortlink has been copied!