summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Metzler <ametzler@downhill.at.eu.org>2015-05-27 13:05:03 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-05-27 13:05:03 +0100
commit488e89462dcfe7db675c8d33cbd25d38f3035902 (patch)
treec10ebea8e9331fc4e1ee32c903a248c8bf15eaea
parent474f71bfffe53a9ade7addd3b0e363251487db79 (diff)
Expand docs re. logs dir, and make eximon logs dir match exim's. Bug 1324
-rw-r--r--doc/doc-docbook/spec.xfpt10
-rw-r--r--src/src/eximon.src25
2 files changed, 25 insertions, 10 deletions
diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index a598ec08b..667857a99 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -14953,8 +14953,9 @@ section &<<SECTmessiden>>&.
This option sets the path which is used to determine the names of Exim's log
files, or indicates that logging is to be to syslog, or both. It is expanded
when Exim is entered, so it can, for example, contain a reference to the host
-name. If no specific path is set for the log files at compile or run time, they
-are written in a sub-directory called &_log_& in Exim's spool directory.
+name. If no specific path is set for the log files at compile or run time,
+or if the option is unset at run time (i.e. &`log_file_path = `&)
+they are written in a sub-directory called &_log_& in Exim's spool directory.
Chapter &<<CHAPlog>>& contains further details about Exim's logging, and
section &<<SECTwhelogwri>>& describes how the contents of &%log_file_path%& are
used. If this string is fixed at your installation (contains no expansion
@@ -34671,8 +34672,9 @@ equivalent to the setting:
.code
log_file_path = $spool_directory/log/%slog
.endd
-If you do not specify anything at build time or run time, that is where the
-logs are written.
+If you do not specify anything at build time or run time,
+or if you unset the option at run time (i.e. &`log_file_path = `&),
+that is where the logs are written.
A log file path may also contain &`%D`& or &`%M`& if datestamped log file names
are in use &-- see section &<<SECTdatlogfil>>& below.
diff --git a/src/src/eximon.src b/src/src/eximon.src
index fac24208c..330d8c518 100644
--- a/src/src/eximon.src
+++ b/src/src/eximon.src
@@ -79,11 +79,12 @@ LOG_FILE_PATH=`$EXIM_PATH -C $config -bP log_file_path | sed 's/.*=[ ]*//'`
# If log_file_path is "syslog" then logging is only to syslog, and the monitor
# is unable to display a log tail unless EXIMON_LOG_FILE_PATH is set to tell
-# it where the log data is. Otherwise, remove any occurrences of
-# "syslog:" or ":syslog" (spaces allowed in various places) and look at the
-# remainder of the entry. If it's null, the default is "mainlog" in the
-# "log" directory in the spool directory. Otherwise, set the name from the
-# given path.
+# it where the log data is. If log_file_path is unset (i.e. empty) the default
+# is "mainlog" in the "log" directory in the spool directory. Otherwise,
+# remove any occurrences of "syslog:" or ":syslog" (spaces allowed in various
+# places) and look at the remainder of the entry. If it's null, check whether
+# LOG_FILE_NAME was set a compile time and contains a path. Otherwise fall
+# back to the default path.
if [ "$EXIMON_LOG_FILE_PATH" != "" ] ; then
LOG_FILE_NAME="$EXIMON_LOG_FILE_PATH"
@@ -94,6 +95,8 @@ elif [ "$LOG_FILE_PATH" = "syslog" ] ; then
echo MAIL.INFO syslog messages into a separate file, you can point eximon at
echo that file with the EXIMON_LOG_FILE_PATH environment variable.
echo \*\*\*
+elif [ "$LOG_FILE_PATH" = "" ] ; then
+ LOG_FILE_NAME=$SPOOL_DIRECTORY/log/mainlog
else
LOG_FILE_NAME=`echo $LOG_FILE_PATH | \
sed -e 's/ *: *syslog *: */:/' \
@@ -101,7 +104,17 @@ else
-e 's/^ *syslog *: *//' \
-e 's/%s/main/'`
if [ "$LOG_FILE_NAME" = "" ] ; then
- LOG_FILE_NAME=$SPOOL_DIRECTORY/log/mainlog
+ COMPILETIMEDEFAULT=`$EXIM_PATH -C /dev/null -bP log_file_path | \
+ sed -e 's/.*=[ ]*//' \
+ -e 's/ *: *syslog *: */:/' \
+ -e 's/ *: *syslog *$//' \
+ -e 's/^ *syslog *: *//' \
+ -e 's/%s/main/'`
+ if [ "$COMPILETIMEDEFAULT" != "" ] ; then
+ LOG_FILE_NAME="$COMPILETIMEDEFAULT"
+ else
+ LOG_FILE_NAME=$SPOOL_DIRECTORY/log/mainlog
+ fi
fi
fi