The LogFormat parameter of apache logs is described in the apache configuration file httpd. by default, logformat & quot; % h % l % u % t \ & quot; % r \ & quot; % & gt; is configured in conf; s % B \ & quot; % {Referer} I \ & quot; the parameter "% {User-Agent} I \ & quo apache log LogFormat" is described in the apache configuration file httpd. by default, logformat "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "is configured in conf \"\" % {User-Agent} I \ "" common this is APACHE log record format settings, what do the parameters in this format mean? The following describes the specific parameters: the request itself will be recorded by placing various "%" escape characters in the format string. when they are written to the log file, they are converted according to the definition in the following table: % Remote IP address % A local IP address % B bytes transferred except the HTTP header % B number of bytes transmitted in addition to the HTTP header in CLF format, that is, when no bytes are transferred, '-' is displayed instead of 0. The content of cookieFoobar that % {Foobar} C sends to the server in the request. % D the time used by the server to process this request, in microseconds. % {FOOBAR} e environment variable FOOBAR value % f file name % h remote host % H request uses protocol % {Foobar} I to the server's request header Foobar: content. % L remote login name (provided by identd, if supported), a "-" will be obtained unless IdentityCheck is set to "On "-". The % m request method % {Foobar} n comes from the annotation Foobar content of another module. % {Foobar} o response header Foobar: content. % P server serves the standard port of the request. % P is the PID of the subprocess that serves the request. % {Format} P serves the PID or TID (thread ID) of the request. the value range of format is pid and tid (2.0.46 and later versions) and hextid (APR1.2.0 or a later version is required) % q query string (if yes, "? "Boot; otherwise, an empty string is returned.) % r indicates the status of the first row of the request % s. For internal redirection requests, this status refers to the status of the original request, and-%> s refers to the status of the final request. % T time, expressed in common log time format (standard English format) % {format} t time, in the format specified by strftime (3. (In the local format by default) % T the time taken to process the request, in seconds. % U remote user name (based on verification information; if the returned status (% s) is 401, it may be false) % U request URL path, does not contain the query string. % V standard ServerName that provides services for this request. % V indicates the server name set according to the UseCanonicalName command. % X connection status when the request is completed: X = the connection is interrupted before the response is completed. + = Keep the connection after the response is sent. -= Close the connection after the response is sent. (In versions later than 1.3, this command is % c, but this is in conflict with the previous SSL syntax: % {var} c) % I received the number of bytes, data that includes the request header cannot be zero. To use this command, you must enable the mod_logio module. The number of bytes sent by % O, including the data in the request header, and cannot be zero. To use this command, you must enable the mod_logio module. The modifier can be followed by a comma-separated list of status codes next to "%" to restrict record entries. For example, "% 400,501 {User-agent} I" only records the User-agent header content when status code 400 and 501 occur. if the conditions are not met, use "-" instead. You can add "! "Prefix indicates no," %! 200,304,302 {Referer} I "records all the Referer header content different from the status code 200,304,302 when it occurs. "<" And ">" modifiers can be used to specify whether to select the original request or the final request for a request that has been internally redirected. By default, % s, % U, % T, % D, % r use the original request, and all other format strings select the final request. For example, %> s can be used to record the final state of the request, while %
S % B "General log format with VM" % v % h % l % u % t \ "% r \" %> s % B "NCSA extended/combined log format "% h % l % u % t \" % r \ "%> s % B \" % {Referer} I \ "\" % {User-agent} I \" "Referer log format" % {Referer} I-> % U "Agent (Browser) logFormat "% h % l % u % t \" % r \ "%> s % B \" % {referer} I \ "\" % {User-Agent} I \ "" common Intermediate "" can be found in the above descriptions for parameters, the last common is actually an identifier in this format. when you apply this format to record logs, you can directly use the identifier, for example: customLog logs/access_log common generates a log file access_log in the common format under logs.
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.