Skip to content

Commit

Permalink
Return an INFO string if log file does not yet exist (#2100)
Browse files Browse the repository at this point in the history
* Return an INFO string if log file does not yet exist

Closes #2090
  • Loading branch information
Birger Schacht authored Sep 6, 2021
1 parent 9eb388e commit 6a94b81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions intelmq/bin/intelmqctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,9 @@ def read_bot_log(self, bot_id, log_level, number_of_lines):
bot_log_path = os.path.join(self._parameters.logging_path,
bot_id + '.log')
if not os.path.isfile(bot_log_path):
self._logger.error("Log path not found: %s", bot_log_path)
return 2, []
message = {'date': datetime.datetime.now().isoformat(), "bot_id": bot_id, "log_level": "INFO", "message": 'No log file exists (yet).'}
self.log_log_messages([message])
return 0, [message]
elif self._parameters.logging_handler == 'syslog':
bot_log_path = '/var/log/syslog'
else:
Expand Down

0 comments on commit 6a94b81

Please sign in to comment.