file: register filedata log before file log

This way the file log can log the 'stored' info that the filedata
log sets.
pull/1315/head
Victor Julien 11 years ago
parent c58b2b4b18
commit cbe934267e

@ -562,47 +562,47 @@ static void SetupOutput(const char *name, OutputModule *module, OutputCtx *outpu
TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries);
SCLogDebug("__tx_logger__ added"); SCLogDebug("__tx_logger__ added");
} }
} else if (module->FileLogFunc) { } else if (module->FiledataLogFunc) {
SCLogDebug("%s is a file logger", module->name); SCLogDebug("%s is a filedata logger", module->name);
OutputRegisterFileLogger(module->name, module->FileLogFunc, output_ctx); OutputRegisterFiledataLogger(module->name, module->FiledataLogFunc, output_ctx);
/* need one instance of the tx logger module */ /* need one instance of the tx logger module */
if (file_logger_module == NULL) { if (filedata_logger_module == NULL) {
file_logger_module = TmModuleGetByName("__file_logger__"); filedata_logger_module = TmModuleGetByName("__filedata_logger__");
if (file_logger_module == NULL) { if (filedata_logger_module == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, SCLogError(SC_ERR_INVALID_ARGUMENT,
"TmModuleGetByName for __file_logger__ failed"); "TmModuleGetByName for __filedata_logger__ failed");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput)); RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput));
if (unlikely(runmode_output == NULL)) if (unlikely(runmode_output == NULL))
return; return;
runmode_output->tm_module = file_logger_module; runmode_output->tm_module = filedata_logger_module;
runmode_output->output_ctx = NULL; runmode_output->output_ctx = NULL;
TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries);
SCLogDebug("__file_logger__ added"); SCLogDebug("__filedata_logger__ added");
} }
} else if (module->FiledataLogFunc) { } else if (module->FileLogFunc) {
SCLogDebug("%s is a filedata logger", module->name); SCLogDebug("%s is a file logger", module->name);
OutputRegisterFiledataLogger(module->name, module->FiledataLogFunc, output_ctx); OutputRegisterFileLogger(module->name, module->FileLogFunc, output_ctx);
/* need one instance of the tx logger module */ /* need one instance of the tx logger module */
if (filedata_logger_module == NULL) { if (file_logger_module == NULL) {
filedata_logger_module = TmModuleGetByName("__filedata_logger__"); file_logger_module = TmModuleGetByName("__file_logger__");
if (filedata_logger_module == NULL) { if (file_logger_module == NULL) {
SCLogError(SC_ERR_INVALID_ARGUMENT, SCLogError(SC_ERR_INVALID_ARGUMENT,
"TmModuleGetByName for __filedata_logger__ failed"); "TmModuleGetByName for __file_logger__ failed");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput)); RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput));
if (unlikely(runmode_output == NULL)) if (unlikely(runmode_output == NULL))
return; return;
runmode_output->tm_module = filedata_logger_module; runmode_output->tm_module = file_logger_module;
runmode_output->output_ctx = NULL; runmode_output->output_ctx = NULL;
TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries);
SCLogDebug("__filedata_logger__ added"); SCLogDebug("__file_logger__ added");
} }
} else if (module->StreamingLogFunc) { } else if (module->StreamingLogFunc) {
SCLogDebug("%s is a streaming logger", module->name); SCLogDebug("%s is a streaming logger", module->name);

Loading…
Cancel
Save