Page 1 of 1

not include php string in writing errors to windows eventlog

Posted: Fri Jan 25, 2008 1:46 pm
by gsaray101
I have this piece of code that writes errors to windows event log. I would like to exclude php string from the event log. How can I do that?

when it writes to eventlog, this is the error: The description for Event ID ( 2 ) in Source ( PHP-5.2.5 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: php[680], sbkeashs02 - CPU _Total went above threshold.

///thi is the code

Code: Select all

 
function logger($desc, $breach_up, $threshld, $currentval, $trigger, $triggerct) {
    define_syslog_variables();
    openlog("CactiTholdLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
 
    $syslog_level = read_config_option('thold_syslog_level');
    if (!isset($syslog_level)) {
        $syslog_level = LOG_WARNING;
    } else if (isset($syslog_level) && ($syslog_level > 7 || $syslog_level < 0)) {
        $syslog_level = LOG_WARNING;
    }
 
    if(strval($breach_up) == "ok") {
        syslog($syslog_level, $desc . " restored to normal");
    } else {
        syslog($syslog_level, $desc . " went " . ($breach_up ? "above" : "below") . " threshold");
    }
}
 
 
 
 

Re: not include php string in writing errors to windows eventlog

Posted: Sat Jan 26, 2008 8:52 am
by JAM
Exclude what (part of) php string?