date.chapril.org-framadate/app/classes/Framadate/Services/LogService.php

25 lines
527 B
PHP
Raw Normal View History

2014-12-24 09:40:41 +01:00
<?php
namespace Framadate\Services;
/**
* This service provides a standard way to log some informations.
*
* @package Framadate\Services
*/
class LogService {
2015-01-06 23:52:52 +01:00
function __construct() {
}
/**
* Log a message to the log file.
*
* @param $tag string A tag is used to quickly found a message when reading log file
* @param $message string some message
*/
function log($tag, $message) {
2015-01-06 23:52:52 +01:00
error_log(date('Ymd His') . ' [' . $tag . '] ' . $message . "\n", 3, LOG_FILE);
2014-12-24 09:40:41 +01:00
}
}