mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Fix logging initialization in daemon
This commit is contained in:
parent
81d0ffbc3b
commit
7d633ec400
@ -1,3 +1,8 @@
|
|||||||
|
Wed Jun 3 11:32:52 BST 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* qemud/qemud.c: Honour LIBVIRT_LOG_FILTERS/OUTPUTS env variables
|
||||||
|
when initializing logging.
|
||||||
|
|
||||||
Tue Jun 2 17:05:52 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
Tue Jun 2 17:05:52 CEST 2009 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
|
* src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
|
||||||
|
@ -2482,6 +2482,11 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
|
|||||||
|
|
||||||
/* there is no default filters */
|
/* there is no default filters */
|
||||||
GET_CONF_STR (conf, filename, log_filters);
|
GET_CONF_STR (conf, filename, log_filters);
|
||||||
|
if (!log_filters) {
|
||||||
|
debugEnv = getenv("LIBVIRT_LOG_FILTERS");
|
||||||
|
if (debugEnv)
|
||||||
|
log_filters = strdup(debugEnv);
|
||||||
|
}
|
||||||
virLogParseFilters(log_filters);
|
virLogParseFilters(log_filters);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2489,7 +2494,12 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
|
|||||||
* all logs to stderr if not running as daemon
|
* all logs to stderr if not running as daemon
|
||||||
*/
|
*/
|
||||||
GET_CONF_STR (conf, filename, log_outputs);
|
GET_CONF_STR (conf, filename, log_outputs);
|
||||||
if (log_outputs == NULL) {
|
if (!log_outputs) {
|
||||||
|
debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
|
||||||
|
if (debugEnv)
|
||||||
|
log_outputs = strdup(debugEnv);
|
||||||
|
}
|
||||||
|
if (!log_outputs) {
|
||||||
if (godaemon) {
|
if (godaemon) {
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
if (virAsprintf (&tmp, "%d:syslog:libvirtd", log_level) < 0)
|
if (virAsprintf (&tmp, "%d:syslog:libvirtd", log_level) < 0)
|
||||||
@ -2499,8 +2509,9 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
|
|||||||
} else {
|
} else {
|
||||||
virLogParseOutputs("0:stderr:libvirtd");
|
virLogParseOutputs("0:stderr:libvirtd");
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
virLogParseOutputs(log_outputs);
|
virLogParseOutputs(log_outputs);
|
||||||
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
free_and_fail:
|
free_and_fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user