--- a/src/server.c
+++ b/src/server.c
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <syslog.h>
 
 #include "utils.h"
 
@@ -520,7 +521,8 @@ int main(int argc, char **argv) {
     return -1;
   }
 
-  lws_set_log_level(debug_level, NULL);
+  openlog("ttyd", LOG_NDELAY | LOG_PID, LOG_DAEMON);
+  lws_set_log_level(debug_level, lwsl_emit_syslog);
 
   char server_hdr[128] = "";
   sprintf(server_hdr, "ttyd/%s (libwebsockets/%s)", TTYD_VERSION, LWS_LIBRARY_VERSION);
