| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | class Simplelog { |
| 9: | private $log; |
| 10: | private $logname; |
| 11: | |
| 12: | public function __construct($logname) { |
| 13: | $this->logname = $logname; |
| 14: | } |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 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: | |
| 27: | |
| 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: | |