From f04095d1f633950851ec37d7d30ce5d5510cc676 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Mon, 8 Aug 2016 14:47:50 +1000 Subject: [PATCH] add PID to log files --- bbs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bbs.c b/bbs.c index 69b9c86..5c1252e 100644 --- a/bbs.c +++ b/bbs.c @@ -41,6 +41,7 @@ void dolog(char *fmt, ...) { struct tm time_now; time_t timen; FILE *logfptr; + int mypid = getpid(); if (conf.log_path == NULL) return; @@ -59,7 +60,7 @@ void dolog(char *fmt, ...) { vsnprintf(buffer, 512, fmt, ap); va_end(ap); - fprintf(logfptr, "%02d:%02d:%02d [%s] %s\n", time_now.tm_hour, time_now.tm_min, time_now.tm_sec, ipaddress, buffer); + fprintf(logfptr, "%02d:%02d:%02d [%d][%s] %s\n", time_now.tm_hour, time_now.tm_min, time_now.tm_sec, mypid, ipaddress, buffer); fclose(logfptr); }