From 57863862cb76248107555cf8a7732acb7d0aea2e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 23 Jan 2015 10:22:55 +0100 Subject: [PATCH] file: register filedata log before file log This way the file log can log the 'stored' info that the filedata log sets. --- src/runmodes.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/runmodes.c b/src/runmodes.c index 998355d7c2..b70453ae48 100644 --- a/src/runmodes.c +++ b/src/runmodes.c @@ -547,47 +547,47 @@ static void SetupOutput(const char *name, OutputModule *module, OutputCtx *outpu TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); SCLogDebug("__tx_logger__ added"); } - } else if (module->FileLogFunc) { - SCLogDebug("%s is a file logger", module->name); - OutputRegisterFileLogger(module->name, module->FileLogFunc, output_ctx); + } else if (module->FiledataLogFunc) { + SCLogDebug("%s is a filedata logger", module->name); + OutputRegisterFiledataLogger(module->name, module->FiledataLogFunc, output_ctx); /* need one instance of the tx logger module */ - if (file_logger_module == NULL) { - file_logger_module = TmModuleGetByName("__file_logger__"); - if (file_logger_module == NULL) { + if (filedata_logger_module == NULL) { + filedata_logger_module = TmModuleGetByName("__filedata_logger__"); + if (filedata_logger_module == NULL) { SCLogError(SC_ERR_INVALID_ARGUMENT, - "TmModuleGetByName for __file_logger__ failed"); + "TmModuleGetByName for __filedata_logger__ failed"); exit(EXIT_FAILURE); } RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput)); if (unlikely(runmode_output == NULL)) return; - runmode_output->tm_module = file_logger_module; + runmode_output->tm_module = filedata_logger_module; runmode_output->output_ctx = NULL; TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); - SCLogDebug("__file_logger__ added"); + SCLogDebug("__filedata_logger__ added"); } - } else if (module->FiledataLogFunc) { - SCLogDebug("%s is a filedata logger", module->name); - OutputRegisterFiledataLogger(module->name, module->FiledataLogFunc, output_ctx); + } else if (module->FileLogFunc) { + SCLogDebug("%s is a file logger", module->name); + OutputRegisterFileLogger(module->name, module->FileLogFunc, output_ctx); /* need one instance of the tx logger module */ - if (filedata_logger_module == NULL) { - filedata_logger_module = TmModuleGetByName("__filedata_logger__"); - if (filedata_logger_module == NULL) { + if (file_logger_module == NULL) { + file_logger_module = TmModuleGetByName("__file_logger__"); + if (file_logger_module == NULL) { SCLogError(SC_ERR_INVALID_ARGUMENT, - "TmModuleGetByName for __filedata_logger__ failed"); + "TmModuleGetByName for __file_logger__ failed"); exit(EXIT_FAILURE); } RunModeOutput *runmode_output = SCCalloc(1, sizeof(RunModeOutput)); if (unlikely(runmode_output == NULL)) return; - runmode_output->tm_module = filedata_logger_module; + runmode_output->tm_module = file_logger_module; runmode_output->output_ctx = NULL; TAILQ_INSERT_TAIL(&RunModeOutputs, runmode_output, entries); - SCLogDebug("__filedata_logger__ added"); + SCLogDebug("__file_logger__ added"); } } else { SCLogDebug("%s is a regular logger", module->name); -- 2.47.3