not include php string in writing errors to windows eventlog

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gsaray101
Forum Newbie
Posts: 1
Joined: Fri Jan 25, 2008 1:42 pm

not include php string in writing errors to windows eventlog

Post 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");
    }
}
 
 
 
 
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

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

Post by JAM »

Exclude what (part of) php string?
Post Reply