82 function ilLog($a_log_path, $a_log_file, $a_tag =
"", $a_enabled =
true, $a_log_level = NULL)
90 $this->current_log_level = $this->
setLogLevel($a_log_level);
93 $this->filename = ($a_log_file) ? $a_log_file :
"ilias.log";
94 $this->tag = ($a_tag ==
"") ?
"unknown" : $a_tag;
95 $this->enabled = (bool) $a_enabled;
96 $this->
setLogFormat(@date(
"[y-m-d H:i:s] ").
"[".$this->tag.
"] ");
111 switch (strtolower($a_log_level))
120 return $this->default_log_level;
133 if (empty($a_log_level))
134 return $this->default_log_level;
136 $level = (int) $a_log_level;
138 if ($a_log_level != (
int) $a_log_level)
139 return $this->default_log_level;
146 $this->log_format = $a_format;
156 $this->path = $a_str;
161 $this->filename = $a_str;
182 $this->
write(
"Language (".$a_lang_key.
"): topic -".$a_topic.
"- not present",$this->MESSAGE);
193 $this->
write(
"WARNING: ".$a_message);
210 $error_level =
"message";
214 $error_level =
"warning";
218 $error_level =
"fatal";
222 $error_level =
"unknown";
226 $this->
write(
"ERROR (".$error_level.
"): ".$a_msg);
243 function write($a_msg, $a_log_level = NULL)
245 if ($this->enabled and $this->current_log_level >= $this->
checkLogLevel($a_log_level))
249 if ($this->fp ==
false)
254 if (fwrite($this->fp,$this->
getLogFormat().$a_msg.
"\n") == -1)
261 if ($a_log_level == $this->FATAL)
276 $this->
write($e->getTraceAsString());
286 function dump($a_var, $a_log_level = NULL)
288 $this->
write(print_r($a_var,
true), $a_log_level);
295 $this->fp = @fopen ($this->path.
"/".$this->filename,
"a");
311 if (@is_file($this->path.
"/".$this->filename))
313 @unlink($this->path.
"/".$this->filename);