1: <?php
2:
3: /**
4: * Description of simplelog
5: *
6: * @author sfrenzel
7: */
8: class Simplelog {
9: private $log;
10: private $logname;
11:
12: public function __construct($logname) {
13: $this->logname = $logname;
14: }
15:
16: /**
17: * write log to a file
18: * @param type $log
19: */
20: public function logmessage($log){
21: file_put_contents('./logs/log_' .$this->logname.'_from_'.date("j.n.Y").'.txt', $log.PHP_EOL, FILE_APPEND);
22:
23: }
24: /**
25: *
26: * @param type $outputFilename
27: * @param type $datacenter
28: */
29: public function savetodayslogtofolder($outputFilename,$datacenter){
30: $todaylog = file_get_contents('./logs/log_' .$this->logname.'_from_'.date("j.n.Y").'.txt');
31:
32: file_put_contents($outputFilename . '0_log_' .$this->logname.'_'.$datacenter.'_from_'.date("j.n.Y").'.txt', print_r($todaylog, true));
33: }
34: }
35: