No BS, the steps are as following -
1. Clone the github project at https://github.com/fukata/ci-log4php
>: git clone https://github.com/fukata/ci-log4php.git
5. Edit the log4php.properties file. Set logs logs folder path
log4php.appender.default.file = /path/to/ci-app/application/logs/%s.log
6. Set the $config['log_threshold'] = 4; in config.php according to :
- | 0 = Disables logging, Error logging TURNED OFF
- | 1 = Error Messages (including PHP errors)
- | 2 = Debug Messages
- | 3 = Informational Messages
- | 4 = All Messages
7. Go inside the application folder and run > chmod -R 777 ./logs
8. Use these commands for logging -
// log_error('thiserror');
// log_info('thisinfo');
// log_debug('thisdebug');