diff options
Diffstat (limited to 'main/syslog.c')
-rw-r--r-- | main/syslog.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/syslog.c b/main/syslog.c index 9171be40b..51da69a8c 100644 --- a/main/syslog.c +++ b/main/syslog.c @@ -163,8 +163,16 @@ static const int logger_level_to_syslog_map[] = { int ast_syslog_priority_from_loglevel(int level) { + /* First 16 levels are reserved for system use. + * Default to using LOG_NOTICE for dynamic logging. + */ + if (level >= 16 && level < ASTNUMLOGLEVELS) { + return LOG_NOTICE; + } + if (level < 0 || level >= ARRAY_LEN(logger_level_to_syslog_map)) { return -1; } + return logger_level_to_syslog_map[level]; } |