summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0df394b)
This option suppresses the PID duplication to syslog. As syslog/systemd
add the PID of the logging process automatically.
.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 &%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"
.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.
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"
.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 synchronous_delivery = FALSE;
BOOL syslog_duplication = TRUE;
int syslog_facility = LOG_MAIL;
uschar *syslog_processname = US"exim";
BOOL syslog_timestamp = TRUE;
uschar *system_filter = NULL;
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 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 */
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 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 */
/* These should be kept in-step with the private delivery error
number definitions in macros.h */
Arguments:
priority syslog priority
Arguments:
priority syslog priority
- s the string to be written
+ s the string to be written, the string may be modified!
if (running_in_test_harness) return;
if (!syslog_timestamp) s += log_timezone? 26 : 20;
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]);
if (LOGGING(pid))
{
sprintf(CS ptr, "[%d] ", (int)getpid());
if (LOGGING(pid))
{
sprintf(CS ptr, "[%d] ", (int)getpid());
+ if (!syslog_pid) pid_position[0] = ptr - log_buffer; // remember begin …
+ if (!syslog_pid) pid_position[1] = ptr - log_buffer; // … and end+1 of the PID
}
if (really_exim && message_id[0] != 0)
}
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 },
{ "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 },
{ "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_strip_trailing_dot
no_syslog_duplication
syslog_facility = uucp
syslog_processname = mta-exim
no_syslog_timestamp
system_filter = /home/exim/test/filter
syslog_processname = mta-exim
no_syslog_timestamp
system_filter = /home/exim/test/filter
tcp_nodelay \
trusted_users \
unknown_login \
tcp_nodelay \
trusted_users \
unknown_login \
+ warn_message_file \
+ syslog_pid
trusted_users = 1234:5678
unknown_login = unknownlogin
warn_message_file = /home/exim/test/warnmsg_file
trusted_users = 1234:5678
unknown_login = unknownlogin
warn_message_file = /home/exim/test/warnmsg_file