PHP Simple Logger


/ Published in: PHP
Save to your folder(s)

This is a really simple logger that can be thrown into any project.


Copy this code and paste it in your HTML
  1. class Debug{
  2. function log($msg){
  3. file_put_contents('logfile.log', strftime('%Y-%m-%d %T'). ': '.$msg. "\n", FILE_APPEND);
  4. }
  5. }
  6. // Usage: Debug::log('put something here');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.