Posted By

ryantxr on 06/14/12


Tagged

logging


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

knedle
clacwebstudio


PHP Simple Logger


 / Published in: PHP
 

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

  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  

You need to login to post a comment.