strftime (3) format. Otherwise, it is automatically added in seconds.. Nnnnnnnnnn suffix. Both formats indicate the start time of the new log.RotationtimeInterval of Log File rollback in secondsOffsetThe number of minutes relative to the UTC time difference. If it is omitted, it is assumed that it is 0 and UTC time is used. For example, to specify the local time of the area with the UTC time difference of-
You can scroll the logs by the hour, using the PHP regular analysis log method to solve
$logLine = ' 127.0.0.1--[22/may/2015:17:09:13 +0800] ' get/sale/images/y-select.png http/1.1 ' 1095 '; $pattern = '/^ (? P
[0-9.] +) - - \[(? P
[^\]]+] \]+ "GET (? P
[^]+) http\/1.[ 1|0|2] "(? P
[0-9.] +) (? P
[0-9.] +)/I ';p reg_match ($pattern, $
format string for strftime (3), otherwise it will be automatically added with the. nnnnnnnnnn suffix in seconds. Both of these formats indicate when the new log is to be used.RotationtimeLog file time interval in seconds for the volume to be returnedOffsetThe number of minutes of time difference relative to UTC. If omitted, 0 is assumed and UTC time is used. For example, to specify local time for a region
[Email protected] ~]# vim/usr/local/apache2/conf/extra/httpd-vhosts.conf650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/79/0B/wKiom1aFRH6w3lq9AAA06EYUr9E441.png "title=" Qq20151231231320.png "alt=" Wkiom1afrh6w3lq9aaa06eyur9e441.png "/>common represents the type name of the access log, we look at a configuration file, in the main profile we can see the format of the
know it happened, but what was wrong? What is the context information?
The third negative example is the "Magic Log". A real example: a lot of programmers on the team know that 3 numbers follow! Number followed by a #, followed by a pseudo-random number of logs means "the message with ID XYZ is received." No one wants to change the log, someone knocks on the keyboard, selects a unique "!#" string, and he
/usr/local/apache2/bin/apachectl-m: See which modules are installed/usr/local/apache/bin/apachectl-v: Viewing the mode used/usr/local/apache2/bin/apachectl-t: Checking for syntax errors/usr/local/apache2/bin/apachectl-l: Viewing the installed library files/usr/local/apache2/bin/apachectl Graceful: Reload configuration/usr/local/apache2/htcocs Home Store Directory/usr/local/apache2/bin/apachectl Startup file directory/usr/local/apache2/conf configurati
: load the database after reentry into aSQL.
Copy Code code as follows:
restore [filename]
Example 5: returns the error condition recorded in the access log. In this example, we will show all requests that return an HTTP status code of 403 (Access Forbidden).
SELECT source, date, status, request from logs WHERE status= ' 403 ' ORDER by date
This example wants to show that although aSQL only analyzes access
After visiting http: 211.100.97.250zabbix today, you can check the access log to see the log format defined in the apache configuration file: customlogsaccess_logcombinedlogformat % h % l % u % t \ % r \ % s % B \ % {Referer} I \ % {User-Agent} I \ combined I access http wit
The site will increase with the amount of traffic, and the log becomes more and more large, if ignored, will someday burst disk.So we should cut the log regularly every day, such as one months later, and then delete the outdated logs to ensure that the log files will not be an infinite amount of disk-occupying resources.configuration: to enter
/apachectl -tSyntax OK[[emailprotected] ~]# /usr/local/apache2/bin/apachectl gracefulDefine all requests to access the pictures as variable img, and exclude them in the access record (log). Accessing the file contents in the format specified in the IMG variable with curl after reloading will not produce an access record.Second, access log cutting
With th
will take apache log analysis as an example to introduce the usage of these two tools:
WebalizerTools
: Http://www.webalizer.org
Features of Webalizer:
1. for programs written in C, it has a high operating efficiency. On a machine with a clock speed of 10000 MHz, webalizer can analyze records per second. Therefore, it takes only 15 seconds to analyze a 40 m log
Apache Log Interpretationwant to know when someone has browsed what's on the site? Check The Apache access log to know. The access log is the standard log for Apache, which explains in
Apache will generate access logs and error logs by default under/usr/local/apache2/logs after the service is available Access_log and error_logIn particular, the access log, in the case of multiple user access, will produce a lot of records. Over time, it may turn into a few g or more than 10 g.In order to alleviate this situation, cutting logs by day, deleting previously useless logs, is a good workaround.
Log pollingMethod 1Download Cronlog softwareCd/home/lvnian/toolswget http://down1.chinaunix.net/distfiles/cronolog-1.6.2.tar.gzTar XF cronolog-1.6.2.tar.gzCD cronolog-1.6.2./configureMake make installLl/usr/local/sbin/cronolog###### #3Cronlog System self-bringing mode. Change access log in httpd.conf or httpd.vhost.conf to the following content# # #按天轮询Customlog "|/usr/local/sbin/cronolog/application/
/httpd/access.log $InputFileTag apache-access: $InputFileStateFile Stat-apache-access $InputFileSeverity Info $InputFilePersistStateInterval 25000 $InputRunFileMonitor # # Apache error log file path, modified according to the actual situation: $InputFileName/var/log/httpd/er
log configuration, Set
CustomLog logs/access_log common
Change
CustomLog "|/usr/sbin/rotatelogs/var/log/httpd/access_log. % Y % m % d 86400" combined
Rotatelogs is a log tool provided by Apache.Rotatelogs to find the path of the tool. In another change, change the log Conte
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.