Duplicated SNMP syslogs

X Z <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
In my application, I set the default syslog level at the beginning, and after parsing a configuration file successfully, I need to reset the syslog level as indicated in the configuration file. So I created the following function:

void set_snmp_log_level(int log_level)
{
    netsnmp_log_handler *logh;
    logh = netsnmp_register_loghandler(NETSNMP_LOGHANDLER_FILE, log_level);
    if (logh) {
        logh->pri_max = LOG_EMERG;
        logh->token = strdup(MYLOGFILE);
    }
}


I noticed that all syslogs were duplicated in MYLOGFILE after I did:

set_snmp_log_level(default);
....
set_snmp_log_level(new);
....
snmp_log(xxxx)

Does anyone know how to reset the syslog level to avoid the duplicated syslogs?

Thanks
Xuan

 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with Microsoft's powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/
http://clk.atdmt.com/GBL/go/177141664/direct/01/

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.