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:
- Log in to your Site24x7 account.
- Download and install the Site24x7 Server Monitoring agent (Windows | Linux).
- Go to Admin > AppLogs > Log Profile and select Add Log Profile.
- Enter the Profile Name.
- 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 16ERROR - 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 16ERROR - 2018-06-19 14:14:48 --> Severity: Warning --> Invalid argument supplied for foreach()
This log is separated into fields, each of which takes its respective value and is then uploaded to Site24x7.
/var/www/planaday.nl/prod/repo/2.4.3/application/controllers/api/v1/private/company/Generic_Get.php 98 - 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.
- The Pattern and Sample Logs are displayed below. By default, this is the log pattern identified by Site24x7 AppLogs for CodeIgniter logs:
- 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" - If your source path is different from the default path, specify it while adding the log profile.
- You can also associate this log profile with monitors, monitor groups, or corresponding servers. Learn more.
- Click Save.