12.3.4 应用日志

12.3.4  应用日志

除了系统日志以外,Linux系统中的应用软件也有自己的日志文件。由于不同的应用软件都会有特殊的日志格式,限于篇幅原因,在这里不能逐一进行介绍,一般情况下这些日志都会存放于软件安装目录下的logs目录下。作为系统管理员,应该清楚如何使用这些日志文件,以便在软件出现故障时能快速找到有效的信息支持。例如,下面是Apache软件错误日志的一个内容截取。

 

//警告信息,进程id文件/usr/local/apache2/logs/httpd.pid被覆盖,上一次关闭可能是非正常的

[Mon Aug 11 22:27:34 2008] [warn] pid file /usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?            

[Mon Aug 11 22:27:34 2008] [notice] Apache/2.2.9 (Unix) configured -- resuming normal operations

//尝试执行目录/usr/local/apache2/cgi-bin/中的脚本

[Mon Aug 11 22:27:40 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/            

[Mon Aug 11 22:27:40 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/

[Mon Aug 11 22:27:41 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/

[Mon Aug 11 22:27:41 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/

//接收到SIGHUP信号,准备重启Apache

[Mon Aug 11 22:29:12 2008] [notice] SIGHUP received.  Attempting to restart

httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

[Mon Aug 11 22:29:12 2008] [notice] Apache/2.2.9 (Unix) configured -- resuming normal operations

[Mon Aug 11 22:29:14 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/

// 找不到文件/usr/local/apache2/htdocs/cgi-bin

[Mon Aug 11 22:29:40 2008] [error] [client 127.0.0.1] File does not exist: /usr/local/apache2/htdocs/cgi-bin       

[Mon Aug 11 22:29:43 2008] [error] [client 127.0.0.1] File does not exist: /usr/local/apache2/htdocs/favicon.ico

[Mon Aug 11 22:30:01 2008] [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/local/apache2/cgi-bin/

 

关于Apache日志更多的说明,请参考16.3.6节的内容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值