# How to do error logging in CodeIgniter (PHP)

Code igniter has logging capabilities built-in. Make sure you do the following:

- Make your `/application/logs` folder writable
- In `/application/config/config.php` set the following:

```php
$config['log_threshold'] = 1;
```

- Use the following syntax to log a message:

```php
log_message('error', 'Some variable did not contain a value.');
```
