如何提高 Fetchmail 的日志级别?

如何提高 Fetchmail 的日志级别?

如何提高 Fetchmail 的日志级别?

这看起来非常简单,但我在网上任何地方都找不到我需要的指令和文件。

答案1

fetchmail(1)man 1 fetchmail):

增加输出的详细程度:

   -v | --verbose
          Verbose mode.  All control messages passed between fetchmail and  the
          mailserver  are echoed to stdout.  Overrides --silent.  Doubling this
          option (-v -v) causes extra diagnostic information to be printed.

关于调试系统日志:

   The  --syslog option (keyword: set syslog) allows you to redirect status and
   error messages emitted to the syslog(3) system daemon  if  available.   Mes-
   sages are logged with an id of fetchmail, the facility LOG_MAIL, and priori-
   ties LOG_ERR, LOG_ALERT or LOG_INFO.  This option is  intended  for  logging
   status  and  error  messages which indicate the status of the daemon and the
   results while fetching mail from the server(s).  Error messages for  command
   line  options and parsing the .fetchmailrc file are still written to stderr,
   or to the specified log file.  The --nosyslog option turns off use  of  sys-
   log(3),  assuming  it’s turned on in the ~/.fetchmailrc file, or that the -L
   or --logfile <file> option was used.

希望有帮助!

答案2

至少在 Debian 中你也可以运行

/etc/init.d/fetchmail debug-run

fetchmail 将直接记录到控制台,而不是进入后台

答案3

当 fetchmail 作为守护进程运行时,增加其详细程度的一种方法是添加'-vv' 添加到 fetchmail 初始化脚本中。例如,在 Debian 中,将 '-vv' 添加到选项参数/etc/init.d/fetchmail,重新启动 fetchmail,然后查看详细输出/var/log/mail.log或者/var/log/syslog

相关内容