From 3e99d080b2a3a9b6eae85ae9e3224534744ad7b9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 30 Sep 2025 00:50:29 +0100 Subject: Write log lines to files on error We call this parking, later we can reattempt ingestion after whatever caused the failure has been fixed. --- src/ingestor.hpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ingestor.hpp') diff --git a/src/ingestor.hpp b/src/ingestor.hpp index 719b65b..42c6699 100644 --- a/src/ingestor.hpp +++ b/src/ingestor.hpp @@ -16,6 +16,7 @@ namespace WebStat { struct IngestorSettings : Settings { std::string dbConnStr = "dbname=webstat user=webstat"; std::string userAgentAPI = "https://useragentstring.com"; + std::filesystem::path fallbackDir = "/var/log/webstat"; unsigned int dbMax = 4; unsigned int dbKeep = 2; }; @@ -38,6 +39,7 @@ namespace WebStat { void ingestLog(std::FILE *); void ingestLogLine(std::string_view); void ingestLogLine(DB::Connection *, std::string_view); + void parkLogLine(std::string_view); template void storeLogLine(DB::Connection *, const std::tuple &) const; @@ -49,6 +51,7 @@ namespace WebStat { size_t linesRead = 0; size_t linesParsed = 0; size_t linesDiscarded = 0; + size_t linesParked = 0; private: static constexpr size_t MAX_NEW_ENTITIES = 6; -- cgit v1.2.3