log/stats: Ensure output exists for the stats thread

Issue: 5198

This commit ensures that a log output destination exists for the stats
thread.
pull/8356/head
Jeff Lucovsky 4 years ago committed by Jeff Lucovsky
parent 018ea2625f
commit e15c9451f2

@ -439,7 +439,14 @@ static OutputInitResult OutputStatsLogInitSub(ConfNode *conf, OutputCtx *parent_
return result;
}
stats_ctx->file_ctx = ajt->file_ctx;
SCLogDebug("Preparing file context for stats submodule logger");
/* Share output slot with thread 1 */
stats_ctx->file_ctx = LogFileEnsureExists(ajt->file_ctx);
if (!stats_ctx->file_ctx) {
SCFree(stats_ctx);
SCFree(output_ctx);
return result;
}
output_ctx->data = stats_ctx;
output_ctx->DeInit = OutputStatsLogDeinitSub;

Loading…
Cancel
Save