Skip to content

Commit 784d633

Browse files
Birger Schachtwaldbauer-certat
authored andcommitted
Return an INFO string if log file does not yet exist (#2100)
* Return an INFO string if log file does not yet exist Closes #2090
1 parent 830e737 commit 784d633

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

intelmq/bin/intelmqctl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,9 @@ def read_bot_log(self, bot_id, log_level, number_of_lines):
767767
bot_log_path = os.path.join(self._parameters.logging_path,
768768
bot_id + '.log')
769769
if not os.path.isfile(bot_log_path):
770-
self._logger.error("Log path not found: %s", bot_log_path)
771-
return 2, []
770+
message = {'date': datetime.datetime.now().isoformat(), "bot_id": bot_id, "log_level": "INFO", "message": 'No log file exists (yet).'}
771+
self.log_log_messages([message])
772+
return 0, [message]
772773
elif self._parameters.logging_handler == 'syslog':
773774
bot_log_path = '/var/log/syslog'
774775
else:

0 commit comments

Comments
 (0)