[Dovecot] /usr/lib/dovecot/imap ignores log settings?
Hi Dovecot peeps,
I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.
I find that it outputs log messages whose severity is INFO to stdout. I'm running it as follows:
/usr/lib/dovecot/imap -c /tmp/dovecot.conf
and I see the following messages output to stdout:
- PREAUTH [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in as paulproteus imap(paulproteus): Info: Connection closed bytes=0/305
Naturally, the first line is great.
My /tmp/dovecot.conf is:
<cut here> # single-dbox mail_location = sdbox:~/Maildir/dbox
log_path = syslog info_log_path = /dev/null </cut>
I'm also attaching strace output, created by running this command:
echo | strace /usr/lib/dovecot/imap -c /tmp/dovecot.conf > /tmp/straced 2>&1
(The point of the "echo | " is to provide a newline and then EOF to /usr/lib/dovecot/imap.)
You can see in the strace output that /usr/lib/dovecot/imap outputs the "Connection closed" message to file descriptor 2. I'd like that message to actually not be printed, which is why I set log_path to syslog.
-- Asheesh.
On 28.12.2011, at 20.31, Asheesh Laroia wrote:
Hi Dovecot peeps,
I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.
I find that it outputs log messages whose severity is INFO to stdout. I'm running it as follows:
/usr/lib/dovecot/imap -c /tmp/dovecot.conf
and I see the following messages output to stdout:
stderr actually.
I'd like that message to actually not be printed, which is why I set log_path to syslog.
Not possible currently. Either do: /usr/lib/dovecot/imap 2>> ~/imap.log Or patch the source: diff -r 056934abd2ef src/imap/main.c --- a/src/imap/main.c Wed Dec 21 14:40:29 2011 +0200 +++ b/src/imap/main.c Thu Dec 29 14:51:12 2011 +0200 @@ -320,6 +320,7 @@ if (IS_STANDALONE()) { service_flags |= MASTER_SERVICE_FLAG_STANDALONE | + MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR | MASTER_SERVICE_FLAG_STD_CLIENT; } else { service_flags |= MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN;
On Thu, 29 Dec 2011, Timo Sirainen wrote:
On 28.12.2011, at 20.31, Asheesh Laroia wrote:
Hi Dovecot peeps,
I'm enjoying running /usr/lib/dovecot/imap directly as a PREAUTH IMAP pipe.
I find that it outputs log messages whose severity is INFO to stdout. I'm running it as follows:
/usr/lib/dovecot/imap -c /tmp/dovecot.conf
and I see the following messages output to stdout:
stderr actually.
Right. Thanks for that; I saw it was file descriptor 2 in the strace after I hit send.
I'd like that message to actually not be printed, which is why I set log_path to syslog.
Not possible currently. Either do:
/usr/lib/dovecot/imap 2>> ~/imap.log
Or patch the source:
[snip]
Great! That should be okay for now.
-- Asheesh.
participants (2)
-
Asheesh Laroia
-
Timo Sirainen