Skip to content

Commit

Permalink
fix: reverting s3c's change to log file format
Browse files Browse the repository at this point in the history
this is necessary to avoid breaking existing field extraction patterns
  • Loading branch information
Florian Roth committed Aug 27, 2019
1 parent 5502121 commit 76cecbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/lokilogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def log_to_file(self, message, mes_type, module):
if self.csv:
logfile.write(self.Format(self.FILE_CSV, u"{0},{1},{2},{3},{4}{5}", getSyslogTimestamp(), self.hostname, mes_type, module, message, self.linesep))
else:
logfile.write(self.Format(self.FILE_LINE, u"{0} {1} LOKI: {2} MODULE: {3} MESSAGE: {4}{5}", getSyslogTimestamp(), self.hostname, mes_type.title(), module, message, self.linesep))
logfile.write(self.Format(self.FILE_LINE, u"{0} {1} LOKI: {2}: MODULE: {3} MESSAGE: {4}{5}", getSyslogTimestamp(), self.hostname, mes_type.title(), module, message, self.linesep))
except Exception as e:
if self.debug:
traceback.print_exc()
Expand All @@ -211,7 +211,7 @@ def log_to_file(self, message, mes_type, module):

def log_to_remotesys(self, message, mes_type, module):
# Preparing the message
syslog_message = self.Format(self.SYSLOG_LINE, "LOKI: {0} MODULE: {1} MESSAGE: {2}", mes_type.title(), module, message)
syslog_message = self.Format(self.SYSLOG_LINE, "LOKI: {0}: MODULE: {1} MESSAGE: {2}", mes_type.title(), module, message)
try:
# Mapping LOKI's levels to the syslog levels
if mes_type == "NOTICE":
Expand Down

0 comments on commit 76cecbb

Please sign in to comment.