From 93c24bff9119b38006cb4896a4b8d1c685ffe15b Mon Sep 17 00:00:00 2001 From: Shawn Smith Date: Mon, 17 Dec 2012 16:19:16 -0600 Subject: [PATCH 1/4] Allow source file and line in Cassandra system.log. --- dogstream/cassandra.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dogstream/cassandra.py b/dogstream/cassandra.py index 88d18d704d..5c92f0a8f0 100644 --- a/dogstream/cassandra.py +++ b/dogstream/cassandra.py @@ -30,11 +30,13 @@ DATE_FORMAT = '%Y-%m-%d %H:%M:%S,%f' LEGACY_DATE_FORMAT = '%Y-%m-%d %H:%M:%S' +# Parse Cassandra default system.log log4j pattern: %5p [%t] %d{ISO8601} %F (line %L) %m%n LOG_PATTERN = re.compile(r"".join([ r"\s*(?P%s)\s+" % "|".join("(%s)" % p for p in LOG4J_PRIORITY), - r"(\[CompactionExecutor:\d*\])?\s*", # thread name and number + r"(\[CompactionExecutor:\d*\]\s+)?", # optional thread name and number r"((?P\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d*)|", r"(?P