]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
file: register filedata log before file log 1315/head
authorVictor Julien <victor@inliniac.net>
Fri, 23 Jan 2015 09:22:55 +0000 (10:22 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Feb 2015 10:39:36 +0000 (11:39 +0100)
This way the file log can log the 'stored' info that the filedata
log sets.

src/runmodes.c

index ce84f78c01e53cd6c9d3c932a6bf4a138701ddf5..35f4e0739aeba3e8cca0df52af8ec70207d489da 100644 (file)
@@ -562,47 +562,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 if (module->StreamingLogFunc) {
         SCLogDebug("%s is a streaming logger", module->name);