Skip to main content

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.

LogContents
applicationGeneric log entries for the application as a whole
av_logEntries relating to antivirus usage in Jadu Central
basicEmailServiceEntries related to the email service
commandsEntries related to cli.php usage
databaseDatabase errors encountered by DataMapper interactions
friendlyURLImportsEntries related to processing of friendly url imports
httpClientEntries related to the HTTP Client
queueEntries related to the Jadu Queueing service
mailEntries 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.

LogDescription
adodb_errors_logEntries related to errors encountered by ADOdb
apache_access_logEntries related to requests received by Apache
apache_error_logEntries related to errors encountered by Apache
cache_logEntries related to application cache
cluster_sync_logEntries related to copying files using ClusterSync
content_schedule_logEntries related to running the content schedule task
lg_logEntries related to generating website statistics from server log files
php_logEntries related to errors encountered by PHP
scheduled_tasks_logEntries related to running scheduled tasks