Logs
Many features of the application include logging to aid diagnosis when an issue occurs.
The table below lists the logs that are available by default within the application.
Log | Contents |
---|---|
application | Generic log entries for the application as a whole |
av_log | Entries relating to antivirus usage in Jadu Central |
basicEmailService | Entries related to the email service |
commands | Entries related to cli.php usage |
database | Database errors encountered by DataMapper interactions |
friendlyURLImports | Entries related to processing of friendly url imports |
httpClient | Entries related to the HTTP Client |
queue | Entries related to the Jadu Queueing service |
mail | Entries related to sending of emails from the applicaton |
Enabling logging
Logging can be enabled by making changes to the config/logs.xml
file found within your Jadu Central application. Below is an example entry from this file.
<item key="application" enable="false" level="warning" description="Jadu Application logs">/path/to/logs/</item>
To turn on logging modify the enable
attribute to be true
and update the path to be where you wish the log file to be created. We recommend using the logs
directory that is located at the root of your Jadu Central application.
The level
option allows you to choose which severity level you would like the application to log. Eight levels are available and these are detailed below along with the type of information each one will log.
- debug: Detailed debug information.
- info: Interesting events. Examples: User logs in, SQL logs.
- notice: Normal but significant events.
- warning: Exceptional occurrences that are not errors.
- error: Runtime errors that do not require immediate action but should typically be logged and monitored.
- critical: Critical conditions.
- alert: Action must be taken immediately.
- emergency: Emergency: system is unusable.
The application will log the level you have selected and anything that is higher in serverity. For example choosing a level of critical
will log critical, alert, and emergency
but no others.
Interacting with logs
To get a log object, call getLog
on the service container object. The log must exist in logs.xml
configuration file prior to being retrieved by the application.
$logger = Jadu_Service_Container::getInstance()->getLog('mylog');
You log a message by calling a method on the logger object retrieved above. The method you call depends upon the type of message you want to log.
$logger->warning('My warning message');
Methods available are:
- debug: Detailed debug information.
- info: Interesting events. Examples: User logs in, SQL logs.
- notice: Normal but significant events.
- warning: Exceptional occurrences that are not errors.
- error: Runtime errors that do not require immediate action but should typically be logged and monitored.
- critical: Critical conditions.
- alert: Action must be taken immediately.
- emergency: Emergency: system is unusable.
Legacy logs
A number of legacy log files exist, which are not configured using logs.xml
, these are as follows.
Log | Description |
---|---|
adodb_errors_log | Entries related to errors encountered by ADOdb |
apache_access_log | Entries related to requests received by Apache |
apache_error_log | Entries related to errors encountered by Apache |
cache_log | Entries related to application cache |
cluster_sync_log | Entries related to copying files using ClusterSync |
content_schedule_log | Entries related to running the content schedule task |
lg_log | Entries related to generating website statistics from server log files |
php_log | Entries related to errors encountered by PHP |
scheduled_tasks_log | Entries related to running scheduled tasks |