/* Since our config is now loaded we can finish configurating the
* logging module. */
- SCLogLoadConfig();
+ SCLogLoadConfig(daemon);
#ifdef __SC_CUDA_SUPPORT__
/* load the cuda configuration */
return;
}
-void SCLogLoadConfig(void)
+void SCLogLoadConfig(int daemon)
{
ConfNode *outputs;
SCLogInitData *sc_lid;
+ int have_logging = 0;
outputs = ConfGetNode("logging.outputs");
if (outputs == NULL) {
"Logging to file requires a filename");
exit(EXIT_FAILURE);
}
+ have_logging = 1;
op_iface_ctx = SCLogInitFileOPIface(filename, format, level);
}
else if (strcmp(output->name, "syslog") == 0) {
}
printf("Initialization syslog logging with format \"%s\".\n",
format);
+ have_logging = 1;
op_iface_ctx = SCLogInitSyslogOPIface(facility, format, level);
}
else {
}
}
+ if (daemon && (have_logging == 0)) {
+ SCLogError(SC_ERR_MISSING_CONFIG_PARAM,
+ "NO logging compatible with daemon mode selected,"
+ " suricata won't be able to log. Please update "
+ " 'logging.outputs' in the YAML.");
+ }
+
SCLogInitLogModule(sc_lid);
SCLogDebug("sc_log_global_log_level: %d", sc_log_global_log_level);
void SCLogRegisterTests(void);
-void SCLogLoadConfig(void);
+void SCLogLoadConfig(int daemon);
#endif /* __UTIL_DEBUG_H__ */