Skip to content

Instantly share code, notes, and snippets.

@cliffparnitzky
Last active October 8, 2015 16:37
Show Gist options
  • Save cliffparnitzky/3358860 to your computer and use it in GitHub Desktop.
Save cliffparnitzky/3358860 to your computer and use it in GitHub Desktop.
Adds simple logging functionality to php file.
function log_message($strMessage, $strLog='error.log')
{
@error_log(sprintf("[%s] %s\n", date('d-M-Y H:i:s'), $strMessage), 3, ROOT_PATH . '/logs/' . $strLog);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment