Files
asterisk/include/asterisk/syslog.h
Matthew Jordan 9065488ddd main/syslog: Allow dynamic logs, such as security events, to log to the syslog
The security event log uses a dynamic log level (SECURITY) that is registered
with the Asterisk logging core. Unfortunately, the syslog would ignore log
statements that had a dynamic log level associated with them. Because the
syslog cannot handle ad hoc dynamic log levels, this patch treats any dynamic
log entries sent to the syslog as logs with a level of NOTICE.

ASTERISK-20744 #close
Reported by: Michael Keuter
Tested by: Michael L. Young, Jacek Konieczny
patches:
  asterisk-20744-syslog-dynamic-logging_trunk.diff uploaded by Michael L. Young (license 5026)
........

Merged revisions 430506 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 430507 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:01:46 +00:00

96 lines
2.4 KiB
C

/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2009, malleable, LLC.
*
* Sean Bright <sean@malleable.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*!
* \file syslog.h
* \brief Syslog support functions for Asterisk logging.
*/
#ifndef _ASTERISK_SYSLOG_H
#define _ASTERISK_SYSLOG_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#define ASTNUMLOGLEVELS 32
/*!
* \since 1.8
* \brief Maps a syslog facility name from a string to a syslog facility
* constant.
*
* \param facility Facility name to map (i.e. "daemon")
*
* \retval syslog facility constant (i.e. LOG_DAEMON) if found
* \retval -1 if facility is not found
*/
int ast_syslog_facility(const char *facility);
/*!
* \since 1.8
* \brief Maps a syslog facility constant to a string.
*
* \param facility syslog facility constant to map (i.e. LOG_DAEMON)
*
* \retval facility name (i.e. "daemon") if found
* \retval NULL if facility is not found
*/
const char *ast_syslog_facility_name(int facility);
/*!
* \since 1.8
* \brief Maps a syslog priority name from a string to a syslog priority
* constant.
*
* \param priority Priority name to map (i.e. "notice")
*
* \retval syslog priority constant (i.e. LOG_NOTICE) if found
* \retval -1 if priority is not found
*/
int ast_syslog_priority(const char *priority);
/*!
* \since 1.8
* \brief Maps a syslog priority constant to a string.
*
* \param priority syslog priority constant to map (i.e. LOG_NOTICE)
*
* \retval priority name (i.e. "notice") if found
* \retval NULL if priority is not found
*/
const char *ast_syslog_priority_name(int priority);
/*!
* \since 1.8
* \brief Maps an Asterisk log level (i.e. LOG_ERROR) to a syslog priority
* constant.
*
* \param level Asterisk log level constant (i.e. LOG_ERROR)
*
* \retval syslog priority constant (i.e. LOG_ERR) if found
* \retval -1 if priority is not found
*/
int ast_syslog_priority_from_loglevel(int level);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* _ASTERISK_SYSLOG_H */