80 function ilLog($a_log_path, $a_log_file, $a_tag =
"", $a_enabled =
true, $a_log_level = NULL)
88 $this->current_log_level = $this->
setLogLevel($a_log_level);
91 $this->filename = ($a_log_file) ? $a_log_file :
"ilias.log";
92 $this->tag = ($a_tag ==
"") ?
"unknown" : $a_tag;
93 $this->enabled = (bool) $a_enabled;
94 $this->
setLogFormat(@date(
"[y-m-d H:i:s] ").
"[".$this->tag.
"] ");
109 switch (strtolower($a_log_level))
118 return $this->default_log_level;
131 if (empty($a_log_level))
132 return $this->default_log_level;
134 $level = (int) $a_log_level;
136 if ($a_log_level != (
int) $a_log_level)
137 return $this->default_log_level;
144 $this->log_format = $a_format;
154 $this->path = $a_str;
159 $this->filename = $a_str;
180 $this->
write(
"Language (".$a_lang_key.
"): topic -".$a_topic.
"- not present",$this->MESSAGE);
191 $this->
write(
"WARNING: ".$a_message);
208 $error_level =
"message";
212 $error_level =
"warning";
216 $error_level =
"fatal";
220 $error_level =
"unknown";
224 $this->
write(
"ERROR (".$error_level.
"): ".$a_msg);
241 function write($a_msg, $a_log_level = NULL)
243 if ($this->enabled and $this->current_log_level >= $this->
checkLogLevel($a_log_level))
247 if ($this->fp ==
false)
252 if (fwrite($this->fp,$this->
getLogFormat().$a_msg.
"\n") == -1)
259 if ($a_log_level == $this->FATAL)
274 $this->
write($e->getTraceAsString());
283 $this->fp = @fopen ($this->path.
"/".$this->filename,
"a");
299 if (@is_file($this->path.
"/".$this->filename))
301 @unlink($this->path.
"/".$this->filename);