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:
Kevin P. Fleming
2005-04-01 16:09:21 +00:00
parent 661770497b
commit 2059316463

View File

@@ -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;
}