}
}
+static bool
+console_logging_enabled(void)
+{
+ enum vlog_module module;
+
+ for (module = 0; module < VLM_N_MODULES; module++) {
+ if (vlog_get_level(module, VLF_CONSOLE) != VLL_EMER) {
+ return true;
+ }
+ }
+ return false;
+}
+
static void
start_secchan(struct bridge *br)
{
/* Assemble command-line arguments. */
svec_init(&argv);
svec_add(&argv, "secchan");
+ svec_add_nocopy(&argv, xasprintf("-vPATTERN:console:%s|secchan-%s|%s",
+ "%d{%b %d %H:%M:%S}", br->name,
+ "%c|%p|%m"));
+ svec_add_nocopy(&argv, xasprintf("-vPATTERN:syslog:secchan-%s|%s",
+ br->name, "%05N|%c|%p|%m"));
+ if (!console_logging_enabled()) {
+ svec_add(&argv, "-vANY:console:EMER");
+ }
+ if (vlog_get_log_file()) {
+ svec_add_nocopy(&argv, xasprintf("--log-file=%s.secchan-%s",
+ vlog_get_log_file(), br->name));
+ }
if (!br->controller) {
svec_add(&argv, "--out-of-band");
svec_add(&argv, "--max-backoff=1");
svec_add(&argv, "--no-stp");
if (!stat(ofp_rundir, &s)) {
svec_add_nocopy(&argv,
- xasprintf("--monitor=punix:%s/secchan%d.monitor",
- ofp_rundir, br->dp_idx));
- }
- svec_add_nocopy(&argv,
- xasprintf("-vPATTERN:console:%s|secchan(nl:%d)|%s",
- "%d{%b %d %H:%M:%S}",
- br->dp_idx,
- "%c|%p|%m"));
+ xasprintf("--monitor=punix:%s/secchan.monitor-%s",
+ ofp_rundir, br->name));
+ }
svec_append(&argv, &br->secchan_opts);
svec_add_nocopy(&argv, xasprintf("nl:%d", br->dp_idx));
if (br->controller) {