mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Put syslog facility/level name into filename field, so it will show in 'logger show channels' (bug #3916)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
6
logger.c
6
logger.c
@@ -157,7 +157,9 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
||||
return NULL;
|
||||
chan = malloc(sizeof(struct logchannel));
|
||||
|
||||
if (chan) {
|
||||
if (!chan) /* Can't allocate memory */
|
||||
return NULL;
|
||||
|
||||
memset(chan, 0, sizeof(struct logchannel));
|
||||
if (!strcasecmp(channel, "console")) {
|
||||
chan->type = LOGTYPE_CONSOLE;
|
||||
@@ -232,6 +234,7 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
||||
}
|
||||
|
||||
chan->type = LOGTYPE_SYSLOG;
|
||||
snprintf(chan->filename, sizeof(chan->filename), "%s", channel);
|
||||
openlog("asterisk", LOG_PID, chan->facility);
|
||||
} else {
|
||||
if (channel[0] == '/') {
|
||||
@@ -255,7 +258,6 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
|
||||
chan->type = LOGTYPE_FILE;
|
||||
}
|
||||
chan->logmask = make_components(components, lineno);
|
||||
}
|
||||
return chan;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user