Commits

Cédric Bonhomme  committed 8cd1b05

When failing to open the log file, the error is reported in the syslog.

  • Participants
  • Parent commits 35fcc07

Comments (0)

Files changed (1)

     Write a message in syslog.
     """
     import syslog
-    syslog.syslog(message)
+    syslog.syslog("pyHIDS - " + message)
 
 def log_mail(mfrom, mto, message):
     """
     try:
         log_file = open(conf.LOGS, "a")
     except Exception as e:
-        print(("Something wrong happens when opening the logs.", e))
+        log_syslog("Something wrong happens when opening the logs: " + str(e))
+        print("Something wrong happens when opening the logs: " + str(e))
         exit(0)
     log(time.strftime("[%d/%m/%y %H:%M:%S] HIDS starting.", \
                            time.localtime()))