diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-30 00:50:29 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-30 00:50:29 +0100 |
commit | 3e99d080b2a3a9b6eae85ae9e3224534744ad7b9 (patch) | |
tree | a978222aed2f4e6f80d8fb934f993e7b5c895091 /src/ingestor.hpp | |
parent | 897546d596d8d7213cff60146123bb8f97d4d1cc (diff) | |
download | webstat-3e99d080b2a3a9b6eae85ae9e3224534744ad7b9.tar.bz2 webstat-3e99d080b2a3a9b6eae85ae9e3224534744ad7b9.tar.xz webstat-3e99d080b2a3a9b6eae85ae9e3224534744ad7b9.zip |
Write log lines to files on error
We call this parking, later we can reattempt ingestion after whatever
caused the failure has been fixed.
Diffstat (limited to 'src/ingestor.hpp')
-rw-r--r-- | src/ingestor.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<typename... T> void storeLogLine(DB::Connection *, const std::tuple<T...> &) 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; |