.row &%slow_lookup_log%& "control logging of slow DNS lookups"
.row &%syslog_duplication%& "controls duplicate log lines on syslog"
.row &%syslog_facility%& "set syslog &""facility""& field"
+.row &%syslog_pid%& "pid in syslog lines"
.row &%syslog_processname%& "set syslog &""ident""& field"
.row &%syslog_timestamp%& "timestamp syslog lines"
.row &%write_rejectlog%& "control use of message log"
details of Exim's logging.
+.option syslog_pid main boolean true
+.cindex "syslog" "pid"
+If &%syslog_pid%& is set false, the PID on Exim's log lines are
+omitted when these lines are sent to syslog. (Syslog normally prefixes
+the log lines with the PID of the logging process automatically.) You need
+to enable the &`+pid`& log selector item, if you want Exim to write it's PID
+into the logs.) See chapter &<<CHAPlog>>& for details of Exim's logging.
+
+
.option syslog_processname main string &`exim`&
.cindex "syslog" "process name; setting"
BOOL synchronous_delivery = FALSE;
BOOL syslog_duplication = TRUE;
int syslog_facility = LOG_MAIL;
+BOOL syslog_pid = TRUE;
uschar *syslog_processname = US"exim";
BOOL syslog_timestamp = TRUE;
uschar *system_filter = NULL;
extern BOOL synchronous_delivery; /* TRUE if -odi is set */
extern BOOL syslog_duplication; /* FALSE => no duplicate logging */
extern int syslog_facility; /* As defined by Syslog.h */
+extern BOOL syslog_pid; /* TRUE if PID on syslogs */
extern uschar *syslog_processname; /* 'ident' param to openlog() */
extern BOOL syslog_timestamp; /* TRUE if time on syslogs */
extern uschar *system_filter; /* Name of system filter file */
static int logging_mode = LOG_MODE_FILE;
static uschar *file_path = US"";
+static size_t pid_position[2];
+
/* These should be kept in-step with the private delivery error
number definitions in macros.h */
Arguments:
priority syslog priority
- s the string to be written
+ s the string to be written, the string may be modified!
Returns: nothing
*/
if (running_in_test_harness) return;
if (!syslog_timestamp) s += log_timezone? 26 : 20;
+if (!syslog_pid && LOGGING(pid))
+ memmove(s + pid_position[0], s + pid_position[1], pid_position[1] - pid_position[0]);
len = Ustrlen(s);
if (LOGGING(pid))
{
sprintf(CS ptr, "[%d] ", (int)getpid());
+ if (!syslog_pid) pid_position[0] = ptr - log_buffer; // remember begin …
while (*ptr) ptr++;
+ if (!syslog_pid) pid_position[1] = ptr - log_buffer; // … and end+1 of the PID
}
if (really_exim && message_id[0] != 0)
{ "strip_trailing_dot", opt_bool, &strip_trailing_dot },
{ "syslog_duplication", opt_bool, &syslog_duplication },
{ "syslog_facility", opt_stringptr, &syslog_facility_str },
+ { "syslog_pid", opt_bool, &syslog_pid },
{ "syslog_processname", opt_stringptr, &syslog_processname },
{ "syslog_timestamp", opt_bool, &syslog_timestamp },
{ "system_filter", opt_stringptr, &system_filter },
no_strip_trailing_dot
no_syslog_duplication
syslog_facility = uucp
+no_syslog_pid
syslog_processname = mta-exim
no_syslog_timestamp
system_filter = /home/exim/test/filter
tcp_nodelay \
trusted_users \
unknown_login \
- warn_message_file
+ warn_message_file \
+ syslog_pid
****
trusted_users = 1234:5678
unknown_login = unknownlogin
warn_message_file = /home/exim/test/warnmsg_file
+no_syslog_pid