Brandyn Lordi
Blog / Coding Tips

Custom PHP logger with rotation functionality

This logger was specifically created for adding logging functionality to WordPress plugins to assist with support. Just drag it into your plugin, specify the directory that will store log files, and that’s it – you are good to go! Github Link <?php function create_new_custom_logger_file($_custom_log_msg, $_custom_log_dir){ $label = time().”.log”; fopen($_custom_log_dir.$label, ‘a’); error_log($_custom_log_msg, 3, $_custom_log_dir.$label); } function […]