在linux/unix上有用 dovecot 作為 imapd/popd的朋友都可能好似我一樣, 覺得 dovecot 的 info 及 log 真的太多太煩. 所以大家都一定會問: 如何可以停止 Dovecot 無需要的 info log呢?
常見很煩擾的info log
Dec 10 09:50:20 sigma dovecot: imap(adrian): Logged out in=80 out=1262 Dec 10 09:50:20 sigma dovecot: imap-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30133, secured, session=<rwUcvE+ZCrB/AAAB> Dec 10 09:50:20 sigma dovecot: imap(adrian): Logged out in=110 out=1282 Dec 10 09:50:21 sigma dovecot: imap-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30134, secured, session=<BgYcvE+ZDLB/AAAB> Dec 10 09:50:21 sigma dovecot: imap(adrian): Logged out in=280 out=1227 Dec 10 09:50:25 sigma dovecot: imap-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30136, secured, session=<PgFovE+ZDrB/AAAB> Dec 10 09:50:25 sigma dovecot: imap(adrian): Logged out in=28 out=769 Dec 10 09:52:21 sigma dovecot: imap-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=30141, secured, session=<dkNEw0+ZELB/AAAB> Dec 10 09:52:21 sigma dovecot: imap(adrian): Logged out in=89 out=882
其實停止的方法很簡單, 只需要在 /etc/dovecot/conf.d加入一個configuration file, 即管叫作 99-suspend-loginfo.conf,所需的指令只是一句
info_log_path = /dev/null
完成後restart dovecot就可以了
service dovecot restart