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

src/runmodes.c

index 998355d7c28ab18fe8c47ca667c3ba67786e7ccc..b70453ae484a0fbdae95a47645be6434daac7228 100644 (file)
@@ -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);