08.10.2017 Views

codeigniter_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CodeIgniter<br />

3. log_message() function is used to write log messages. This is useful when you<br />

want to write custom messages.<br />

Syntax<br />

Parameters<br />

Return Type<br />

log_message($level, $message, $php_error = FALSE)<br />

<br />

<br />

<br />

void<br />

$level (string) – Log level: ‘error’, ‘debug’ or ‘info’<br />

$message (string) – Message to log<br />

$php_error (bool) – Whether we’re logging a native<br />

PHP error message<br />

Logging can be enabled in application/config/config.php file. Given below is the<br />

screenshot of config.php file, where you can set threshold value.<br />

You can find the log messages in application/log/. Make sure that this directory is<br />

writable before you enable log files.<br />

Various templates for error messages can be found in application/views/errors/cli or<br />

application/views/errors/html.<br />

38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!