====== Logging ======
System and PHP errors are written to an application log file. For information on writing log messages or accessing log files, see [[core:kohana|Kohana Log methods]].
The configuration settings for logging are accessible in the core configuration file ''config.php'' located in ''application/config''. See [[general:configuration|Configuration]] for more information.
There are only two config settings for Logging:
/**
* Log thresholds:
* 0 - Disable logging
* 1 - Errors and exceptions
* 2 - Warnings
* 3 - Notices
* 4 - Debugging
*/
$config['log_threshold'] = 1;
/**
* Message logging directory.
*/
$config['log_directory'] = APPPATH.'logs';
When ''log_threshold'' is set to ''4'' it will also log 3, 2 and 1, since lower levels are always included.
* Level 1 is recommended in an production environment as it will only log errors.
* Level 2 and 3 are used for custom logging by applications.
* Level 4 is useful for debugging; it will log all libraries loaded and any errors.
Kohana by default, does not log anything to level 2 or 3.
''$config['log_directory']'' log file directory can be relative to ''application/'' or absolute.
Setting the level to 4 can slow down your application significantly.
Note that these levels correspond to Kohana::log(level, message) calls as such:
* 1 - 'error' (Errors & Exceptions)
* 2 - 'alert' (Warnings)
* 3 - 'info' (Notices)
* 4 - 'debug' (Debugging)