解决Apache的错误日志巨大的问题以及关闭Apache web日志记录
调整错误日志的级别
这几天 apache错误日志巨大 莫名其妙的30G 而且 很多都是那种页面不存在的 网站太多了 死链接相应的也很多
于是把错误警告调低了
因为写日志会给系统带来很大的损耗。关闭日志以后,甚至最高可以提高整体性能近40%(粗略估计)那么如何关闭日志呢?
可以通过降低log级别的办法来减少日志读写。
这里要提醒的是,这么做将给“入侵检测”以及其他基于日志分析的工作带来麻烦。所以请谨慎使用。
网上相关文章很多,但说的都不详细,擦边而过,下面详细说一下具体操作步骤。
编辑conf文件夹下的httpd.conf,找到如下内容:
=====================
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
=====================
其中,LogLevel用于调整记于错误日志中的信息的详细程度。(参阅ErrorLog指令)。可以选择下列级别,依照重要性降序排列:
Level Description Example
emerg 紧急 – 系统无法使用。 “Child cannot open lock file. Exiting”
alert 必须立即采取措施。 “getpwuid: couldn’t determine user name from uid”
crit 致命情况。 “socket: Failed to get a socket, exiting child”
error 错误情况。 “remature end of script headers”
warn 警告情况。 “child process 1234 did not exit, sending another SIGHUP”
notice 一般重要情况。 “httpd: caught SIGBUS, attempting to dump core in …”
info 普通信息。 “Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)…”
debug 出错级别信息 “Opening config file …”
默认级别是warn,那么warn级别以上的日志都会记录,会产生大量“文件不存在”的erro级别的错误日志。建议使用 crit 级别的设置,这样只记录致命级别以上的日志,有效减少日志数量。
把LogLevel warn更改为LogLevel crit 然后重启apache即可。
将Httpd.conf 配置文件中的ErrorLog 参数改为下面的,就可以将日志按每天生成一个日志文件.
ErrorLog “|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 1M”
ErrorLog “|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 86400″
以上是关闭apache错误日志的办法!!!
关闭 WEB日志的方法
在httpd.conf文件中,有如下一行,你删除了就不产生日志了。我是注释的方式,如:
#CustomLog "logs/access_log" common
这一行可能因你的配置不同有所修改,不一定完全相同。搜索一下就能定位到。方法就这么简单吧。最后记得要重启web服务(不用重启服务器)才有效。
解决Apache的错误日志巨大的问题以及关闭Apache web日志记录的更多相关文章
- 我的日志分析之道:简单的Web日志分析脚本
前言 长话短说,事情的起因是这样的,由于工作原因需要分析网站日志,服务器是windows,iis日志,在网上找了找,github找了找,居然没找到,看来只有自己动手丰衣足食. 那么分析方法我大致可分为 ...
- 【处理多服务器日志合并处理问题】多服务器的日志合并统计——apache日志的cronolog轮循
转发:http://www.chedong.com/tech/rotate_merge_log.html 内容摘要:你完全不必耐心地看完下面的所有内容,因为结论无非以下2点:1 用 cronolo ...
- kylin加载hive表错误:ERROR [http-bio-7070-exec-10] controller.TableController:189 : org/apache/hadoop/hive/conf/HiveConf java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf 解决办法
一.问题背景 在kylin中加载hive表时,弹出提示框,内容是“oops!org/apache/hadoop/hive/conf/HiveConf”,无法加载hive表,查找kylin的日志时发现, ...
- 解决apache启动错误"httpd:Could not reliably determine..."
启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [root@serv ...
- apache安装错误error: APR not found解决办法
linux安装时安装种类不同,一些组件包可能不会被安装,导致linux下安装软件的时候缺这个缺那个,今天为大家介绍linux安装apache时报apr找不到的解决办法 方法/步骤 下载依赖包 wg ...
- 解决apache启动错误:Could not reliably determine the server's fully qualified domain name
启动apache遇到错误:httpd: Could not reliably determine the server's fully qualified domain name [root@serv ...
- 解决mybatis foreach 错误: Parameter '__frch_item_0' not found
解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spr ...
- hadoop错误Ignoring exception during close for org.apache.hadoop.mapred.MapTask$NewOutputCollector@17bda0f2 java.io.IOException Spill failed
1.错误 Ignoring exception during close for org.apache.hadoop.mapred.MapTask$NewOutputCollector@17bd ...
- oracle 外部表及解决ora-29400,ora-29913错误
对外部表的理解及测试,,,,如有理解不正确请大家指正 语法: create table 表名( 列名1,列名2,...... ) organization external ###说明创建外部表 ( ...
随机推荐
- FusionCharts使用问题及解决方法(五)-FusionCharts常见问题大全
在前4篇文章中,我们总结了FusionCharts XT图表使用中的一些常见问题(FAQ)及解决方法,本文继续讨论FusionCharts使用者常见的一些复杂报错及错误的调试/解决方法. 问题描述:是 ...
- Struts+Spring+Hibernate的Web应用执行过程
struts1和spring有两种整合的方法 一种是action和spring bean映射:一种是将action交给spring初始化 第一种方式:访问.do的URL->tomcat接收到r ...
- mysql查询数据库约束
SELECT * FROM information_schema.`TABLE_CONSTRAINTS` where TABLE_SCHEMA='mold' and TABLE_NAME='tplmi ...
- iOS触摸事件深入
转载自:http://www.cnblogs.com/wengzilin/p/4720550.html 概述 本文主要解析从我们的手指触摸苹果设备到最终响应事件的整个处理机制.本质上讲,整个过程可以分 ...
- PAT (Advanced Level) 1056. Mice and Rice (25)
简单模拟. #include<iostream> #include<cstring> #include<cmath> #include<algorithm&g ...
- 请问如何在PS中将一张图标里的各个小图标分离成一个个图标?
1.用切片工具比较简单快捷,把要切的图标一个个的切画出来,切好后存储保存格式为web,导出时候会出现一个images文件里面就是刚切好的图片 2.用裁剪的方式裁剪你要小图标,(你可以记住第一个裁剪的长 ...
- Java时间操作(一):关于UTC格式时间处理
Java中获取形如:20160811T122132+08 格式,可以通过如下方法 package com.mc.others; public class UTCTimeTest { @Test pub ...
- Delphi XE7,Rad Studio XE7 官方下载(附Delphi XE7破解),更新Update1(转)
源:http://blog.csdn.net/maxwoods/article/details/39024525
- 转 mybatis javaType与jdbcType对应
java.sql.Types 值 Java 类型 IBM DB2 Oracle Sybase SQL Informix IBM Content Manager BIGINT java.lang.l ...
- jsp显示计算数值, 四舍五入
<script>document.write(Math.round(<%= rs_MFM.getInt("PVRCompl") %>/<%= rs_M ...