function filelog_watchdog in File Log 7
Same name and namespace in other branches
- 6.2 filelog.module \filelog_watchdog()
- 6 filelog.module \filelog_watchdog()
Implementation of hook_watchdog().
File
- ./
filelog.module, line 12 - Writes logging messages into files.
Code
function filelog_watchdog(array $entry) {
$f = _filelog_get_conf();
if ($entry['severity'] <= $f['log_level']) {
if ($dir = filelog_directory()) {
$file = filelog_filename($entry);
$retry = 0;
while ($retry < 3) {
if ($fp = @fopen($dir . '/' . $file, 'ab')) {
fwrite($fp, theme('filelog_format', array(
'entry' => $entry,
)) . "\n");
fclose($fp);
$retry = 3;
break;
}
$retry++;
usleep(250);
}
}
}
}