LogLevel 的更多选项
- debug2 - 记录一切。
- debug - 记录几乎所有内容。
- info - 记录所有请求和状态更改。
- warn - 记录错误和警告。
- error - 仅记录错误。
- none - 不记录任何内容。
下面的步骤将指导如何配置 CUPS 以生成调试信息以及如何捕获它。
欢迎来到之路教程(on itroad-com)
如何捕获日志
以 root 用户身份打开两个不同的终端窗口。
其中一个终端中运行以下命令:
# tail -f /var/log/cups/error_log > /tmp/cups_debug_error.txt
在执行以下步骤时运行此命令。
- 在另一个终端中,执行以下操作:
# service cups restart
- 现在按照步骤重新创建我们在使用打印机时遇到的问题。
第一个终端,按,Ctrl-C 停止 tail 命令。
捕获日志后,将 Loglevel 重置为默认值并重新启动 cups 服务。
配置
- 使用文本编辑器打开cups 配置文件/etc/cups/cupsd.conf。
# vi /etc/cups/cupsd.conf
它看起来像这样:
MaxLogSize 0 # # "$Id: cupsd.conf.in 8805 2009-08-31 16:34:06Z mike $" # # Sample configuration file for the CUPS scheduler. See "man cupsd.conf" for a # complete description of this file. # # Log general information in error_log - change "warn" to "debug" # for troubleshooting... LogLevel warn
或者
# # "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $" # # Sample configuration file for the Common UNIX Printing System (CUPS) # scheduler. See "man cupsd.conf" for a complete description of this # file. # # Log general information in error_log - change "info" to "debug" for # troubleshooting... LogLevel info
- 我们需要编辑 LogLevel 行,如下所示:
LogLevel debug2
- 现在保存文件。
日期:2020-09-17 00:13:34 来源:oir作者:oir