From: Arjen Baart Date: Sun, 13 Sep 2020 08:25:47 +0000 (+0200) Subject: Adjusted date expression for apahce error log X-Git-Url: http://www.andromeda.nl/gitweb/?p=gnucomo.git;a=commitdiff_plain;h=9e47a3b4d8f5da5ff609b542c2b18baf95c9469c Adjusted date expression for apahce error log --- diff --git a/src/gcm_input/error_cooker.cpp b/src/gcm_input/error_cooker.cpp index 4311414..63fa891 100644 --- a/src/gcm_input/error_cooker.cpp +++ b/src/gcm_input/error_cooker.cpp @@ -50,8 +50,8 @@ #include "error_cooker.h" -static const String unix_date_re("[[:alpha:]]{3} [[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]{4}"); -static const regex re_errorlog("^\\[" + unix_date_re + "\\] \\[(error|notice|warn|info)\\] .+"); +static const String unix_date_re("[[:alpha:]]{3} [[:alpha:]]{3} [ 0123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)? [0-9]{4}"); +static const regex re_errorlog("^\\[" + unix_date_re + "\\] \\[.*(error|notice|warn|info|debug)\\] .+"); bool error_cooker::check_pattern(String logline) { diff --git a/src/gcm_input/message.cpp b/src/gcm_input/message.cpp index 185fa0e..9e761b5 100644 --- a/src/gcm_input/message.cpp +++ b/src/gcm_input/message.cpp @@ -540,6 +540,11 @@ void client_message::enterXML() } log_service = pan.lc->service(); log_date = pan.lc->timestamp(); + + if (!log_date.proper()) + { + *Log << log_date << " is not a valid timestamp.\n"; + } } else { @@ -634,6 +639,10 @@ void client_message::enterXML() } } + else + { + *Log << "Can not insert log element " << raw << ".\n"; + } } node = node->next;