64 function __construct($a_log_path, $a_log_file, $a_tag =
"", $a_enabled =
true, $a_log_level = NULL)
67 include_once
'./Services/Logging/classes/public/class.ilLogLevel.php';
74 $this->current_log_level = $this->
setLogLevel($a_log_level);
76 $this->path = ($a_log_path) ? $a_log_path : ILIAS_ABSOLUTE_PATH;
77 $this->filename = ($a_log_file) ? $a_log_file :
"ilias.log";
78 $this->tag = ($a_tag ==
"") ?
"unknown" : $a_tag;
79 $this->enabled = (bool) $a_enabled;
96 switch (strtolower($a_log_level))
105 return $this->default_log_level;
118 if (empty($a_log_level))
119 return $this->default_log_level;
121 $level = (int) $a_log_level;
123 if ($a_log_level != (
int) $a_log_level)
124 return $this->default_log_level;
131 $this->log_format = $a_format;
141 $this->path = $a_str;
153 $this->filename = $a_str;
181 $this->
write(
"Language (".$a_lang_key.
"): topic -".$a_topic.
"- not present",$this->MESSAGE);
192 $this->
write(
"WARNING: ".$a_message);
209 $error_level =
"message";
213 $error_level =
"warning";
217 $error_level =
"fatal";
221 $error_level =
"unknown";
225 $this->
write(
"ERROR (".$error_level.
"): ".$a_msg);
242 function write($a_msg, $a_log_level = NULL)
244 if ($this->enabled
and $this->current_log_level >= $this->
checkLogLevel($a_log_level))
248 if ($this->fp ==
false)
253 if (fwrite($this->fp,$this->
getLogFormat().$a_msg.
"\n") == -1)
260 if ($a_log_level == $this->FATAL)
275 $this->
write($e->getTraceAsString());
285 function dump($a_var, $a_log_level = NULL)
287 $this->
write(print_r($a_var,
true), $a_log_level);
298 $this->fp = @fopen ($this->path.
"/".$this->filename,
"a");
301 if (!$this->fp && $this->enabled)
303 include_once(
"./Services/Logging/exceptions/class.ilLogException.php");
304 throw new ilLogException(
'Unable to open log file for writing. Please check setup path to log file and possible write access.');
320 if (@is_file($this->path.
"/".$this->filename))
322 @unlink($this->path.
"/".$this->filename);
writeLanguageLog($a_topic, $a_lang_key)
special language checking routine
ILIAS Log exception class.
dump($a_var, $a_log_level=NULL)
Dump a variable to the log.
__construct($a_log_path, $a_log_file, $a_tag="", $a_enabled=true, $a_log_level=NULL)
constructor
checkLogLevel($a_log_level)
determine log level
setLogLevel($a_log_level)
set global log level
write($a_msg, $a_log_level=NULL)
logging
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
logError($a_code, $a_msg)
this function is automatically called by class.ilErrorHandler in case of an error To log manually ple...
writeWarning($a_message)
special warning message