.TH "generic logging for net-snmp" 3 "24 Nov 2004" "net-snmp" \" -*- nroff -*- .ad l .nh .SH NAME generic logging for net-snmp \- .SS "Defines" .in +1c .ti -1c .RI "#define \fBLOGLENGTH\fP 1024" .br .ti -1c .RI "#define \fBLOG_CONS\fP 0 /* Don't bother if not defined... */" .br .ti -1c .RI "#define \fBLOG_PID\fP 0 /* Don't bother if not defined... */" .br .ti -1c .RI "#define \fBLOG_LOCAL0\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL1\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL2\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL3\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL4\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL5\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL6\fP 0" .br .ti -1c .RI "#define \fBLOG_LOCAL7\fP 0" .br .ti -1c .RI "#define \fBLOG_DAEMON\fP 0" .br .ti -1c .RI "#define \fBLOG_USER\fP 0" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBvsnprintf\fP (char *str, size_t count, const char *fmt, va_list arg)" .br .ti -1c .RI "void \fBinit_snmp_logging\fP (void)" .br .ti -1c .RI "int \fBdecode_priority\fP (char *optarg, int *pri_max)" .br .ti -1c .RI "int \fBdecode_facility\fP (char *optarg)" .br .ti -1c .RI "int \fBsnmp_log_options\fP (char *optarg, int argc, char *const *argv)" .br .ti -1c .RI "char * \fBsnmp_log_syslogname\fP (char *pstr)" .br .ti -1c .RI "void \fBsnmp_log_options_usage\fP (const char *lead, FILE *outf)" .br .ti -1c .RI "int \fBsnmp_get_do_logging\fP (void)" .br .RI "\fIThis snmp logging function allows variable argument list given the specified priority, format and a populated va_list structure. \fP" .ti -1c .RI "void \fBsnmp_disable_syslog_entry\fP (netsnmp_log_handler *logh)" .br .ti -1c .RI "void \fBsnmp_disable_syslog\fP (void)" .br .ti -1c .RI "void \fBsnmp_disable_filelog_entry\fP (netsnmp_log_handler *logh)" .br .ti -1c .RI "void \fBsnmp_disable_filelog\fP (void)" .br .ti -1c .RI "void \fBsnmp_disable_stderrlog\fP (void)" .br .ti -1c .RI "void \fBsnmp_disable_calllog\fP (void)" .br .ti -1c .RI "void \fBsnmp_disable_log\fP (void)" .br .ti -1c .RI "void \fBsnmp_enable_syslog\fP (void)" .br .ti -1c .RI "void \fBsnmp_enable_syslog_ident\fP (const char *ident, const int facility)" .br .ti -1c .RI "void \fBnetsnmp_enable_filelog\fP (netsnmp_log_handler *logh, int dont_zero_log)" .br .ti -1c .RI "void \fBsnmp_enable_filelog\fP (const char *logfilename, int dont_zero_log)" .br .ti -1c .RI "void \fBsnmp_enable_stderrlog\fP (void)" .br .ti -1c .RI "void \fBsnmp_enable_calllog\fP (void)" .br .ti -1c .RI "netsnmp_log_handler * \fBnetsnmp_find_loghandler\fP (const char *token)" .br .ti -1c .RI "int \fBnetsnmp_add_loghandler\fP (netsnmp_log_handler *logh)" .br .ti -1c .RI "netsnmp_log_handler * \fBnetsnmp_register_loghandler\fP (int type, int priority)" .br .ti -1c .RI "int \fBnetsnmp_enable_loghandler\fP (const char *token)" .br .ti -1c .RI "int \fBnetsnmp_disable_loghandler\fP (const char *token)" .br .ti -1c .RI "int \fBnetsnmp_remove_loghandler\fP (netsnmp_log_handler *logh)" .br .ti -1c .RI "int \fBlog_handler_stdouterr\fP (netsnmp_log_handler *logh, int pri, const char *string)" .br .ti -1c .RI "int \fBlog_handler_syslog\fP (netsnmp_log_handler *logh, int pri, const char *string)" .br .ti -1c .RI "int \fBlog_handler_file\fP (netsnmp_log_handler *logh, int pri, const char *string)" .br .ti -1c .RI "int \fBlog_handler_callback\fP (netsnmp_log_handler *logh, int pri, const char *string)" .br .ti -1c .RI "int \fBlog_handler_null\fP (netsnmp_log_handler *logh, int pri, const char *string)" .br .ti -1c .RI "void \fBsnmp_log_string\fP (int priority, const char *string)" .br .ti -1c .RI "int \fBsnmp_vlog\fP (int priority, const char *format, va_list ap)" .br .ti -1c .RI "int \fBsnmp_log\fP (va_alist)" .br .RI "\fIThis snmp logging function allows variable argument list given the specified format and priority. \fP" .ti -1c .RI "void \fBsnmp_log_perror\fP (const char *s)" .br .ti -1c .RI "netsnmp_log_handler * \fBget_logh_head\fP (void)" .br .in -1c .SS "Variables" .in +1c .ti -1c .RI "netsnmp_log_handler * \fBlogh_head\fP" .br .ti -1c .RI "netsnmp_log_handler * \fBlogh_priorities\fP [LOG_DEBUG+1]" .br .in -1c .SH "Function Documentation" .PP .SS "int snmp_get_do_logging (void)" .PP This snmp logging function allows variable argument list given the specified priority, format and a populated va_list structure. The default logfile this function writes to is /var/log/snmpd.log. .PP \fBParameters:\fP .RS 4 \fIpriority\fP is an integer representing the type of message to be written to the snmp log file. The types are errors, warning, and information. The error types are: .IP "\(bu" 2 LOG_EMERG system is unusable .IP "\(bu" 2 LOG_ALERT action must be taken immediately .IP "\(bu" 2 LOG_CRIT critical conditions .IP "\(bu" 2 LOG_ERR error conditions The warning type is: .IP "\(bu" 2 LOG_WARNING warning conditions The information types are: .IP "\(bu" 2 LOG_NOTICE normal but significant condition .IP "\(bu" 2 LOG_INFO informational .IP "\(bu" 2 LOG_DEBUG debug-level messages .PP .br \fIformat\fP is a pointer to a char representing the variable argument list format used. .br \fIap\fP is a va_list type used to traverse the list of arguments. .RE .PP \fBReturns:\fP .RS 4 Returns 0 on success, -1 when the code could not format the log- string, -2 when dynamic memory could not be allocated if the length of the log buffer is greater then 1024 bytes. For each of these errors a LOG_ERR messgae is written to the logfile. .RE .PP \fBSee also:\fP .RS 4 \fBsnmp_log\fP .RE .PP Definition at line 465 of file snmp_logging.c. .SS "int snmp_log (va_alist)" .PP This snmp logging function allows variable argument list given the specified format and priority. Calls the snmp_vlog function. The default logfile this function writes to is /var/log/snmpd.log. .PP \fBSee also:\fP .RS 4 snmp_vlog .RE .PP .PP \fBExamples: \fP .in +1c \fBdelayed_instance.c\fP. .PP Definition at line 1139 of file snmp_logging.c. .PP Referenced by _request_set_error(), agent_check_and_process(), init_agent(), netsnmp_baby_steps_handler_get(), netsnmp_cache_create(), netsnmp_cache_helper_handler(), netsnmp_cache_timer_start(), netsnmp_cache_timer_stop(), netsnmp_call_handler(), netsnmp_call_next_handler(), netsnmp_call_next_handler_one_request(), netsnmp_container_table_handler_get(), netsnmp_data_list_add_data(), netsnmp_data_list_add_node(), netsnmp_get_multiplexer_handler(), netsnmp_get_table_data_handler(), netsnmp_get_table_data_set_handler(), netsnmp_get_table_handler(), netsnmp_inject_handler_before(), netsnmp_mark_row_column_writable(), netsnmp_multiplexer_helper_handler(), netsnmp_read_data_callback(), netsnmp_register_handler(), netsnmp_register_handler_nocallback(), netsnmp_register_save_list(), netsnmp_request_set_error_all(), netsnmp_save_all_data_callback(), netsnmp_set_row_column(), netsnmp_table_container_register(), netsnmp_table_data_add_row(), netsnmp_table_data_set_helper_handler(), netsnmp_table_iterator_helper_handler(), netsnmp_table_set_add_default_row(), read_config_store(), snmp_call_callbacks(), snmp_unregister_callback(), and table_helper_handler().