<-
Apache > HTTP Server > Documentation > Version 2.5 >

ġ mod_log_config

ֽ ƴմϴ. ֱٿ ϼ.
: û α׿ Ѵ
:Base
:log_config_module
ҽ:mod_log_config.c

Ŭ̾Ʈ û α׿ Ӱ Ѵ. ڽ ϴ α׸ ְ, ̳ ܺ α׷ α׸ ִ. α׸ ϸ û ݿ û α׿ ߰ϰų ִ.

þ Ѵ. TransferLog α , LogFormat ϴ ϰ, CustomLog ѹ αϰ Ѵ. TransferLog CustomLog þ ϸ û Ͽ ִ.

þ

Bugfix checklist

top

α ϱ

LogFormat CustomLog þ ƱԸƮ ڿ̴. ڿ û αϿ Ѵ. ڿ αϿ ״ Ǵ ڿ ٲް Ÿ C "\n" "\t" ڸ ִ. αϿ ǥ 齽 տ ݵ 齽 Ѵ.

û Ư¡ ڿ "%" þ Ͽ Ѵ. þ αϿ ȴ.

 ڿ
%% ۼƮ ȣ
%...a IP-ּ
%...A () IP-ּ
%...B HTTP Ʈ.
%...b HTTP Ʈ. CLF İ 0 '-' ´.
%...{Foobar}C û Foobar Ű .
%...D û óϴµ ɸ ð (ũ ).
%...{FOOBAR}e ȯ溯 FOOBAR
%...f ϸ
%...h ȣƮ
%...H û
%...{Foobar}i û Foobar: .
%...l (ִٸ identd ) αθ. mod_ident ְ IdentityCheck On ƴϸ ȣ Ѵ.
%...m û ޽
%...{Foobar}n ٸ Foobar Ʈ(note) .
%...{Foobar}o Foobar: .
%...p û ϴ Ʈ
%...P û ϴ ڽ μ ID.
%...{format}P û ϴ ڽ μ ID Ȥ ID. format pid tid ϴ.
%...q ǹڿ (ǹڿ ִٸ տ ? ̰, ٸ ڿ)
%...r û ù°
%...s (status). ̷ǵ û ** û ̴. û ´ %...>s.
%...t common log format ð (ǥ ) ð
%...{format}t strftime(3) format ð. (ð )
%...T û óϴµ ɸ ð ( ).
%...u (auth ϸ, (%s) 401 ̻ )
%...U ǹڿ û URL .
%...v û ServerName.
%...V UseCanonicalName .
%...X .
X = ġ .
+ = Ŀ ִ(keep alive).
- = .

(ġ 1.3 Ĺ þ %...c, ssl %...{var}c ļ ߴ.)

%...I û Ʈ 0 . ̸ Ϸ mod_logio ʿϴ.
%...O ۽ Ʈ 0 . ̸ Ϸ mod_logio ʿϴ.

"..." ( , "%h %u %r %s %b") ƹ͵ ų, ׸ ´ ( ڸ "-" Ѵ). տ "!" ̰ų Ⱥ HTTP ڵ ۼѴ. , "%400,501{User-agent}i" 400 (Bad Request) 501 (Not Implemented) ϶ User-agent: α׿ , "%!200,304,302{Referer}i" ° ƴ û Referer: α׿ .

"<" ">" ̷ǵ û ó û û Ѵ. ⺻ %s, %U, %T, %D, %r ó û , % þ û . ׷ %>s û (status) ϰ, %<u ȣ ʴ ڿ ̷ǵ 쿡 ó ڸ Ѵ.

2.0.46 httpd 2.0 %...r, %...i, %...o ڿ ״ ξ. Common Log Format 䱸 ؼ. , Ŭ̾Ʈ ڸ α׿ ֱ⶧ α ״ ٷ ؾ Ѵ.

Ȼ 2.0.46 ڳ ٸ Ưڸ \xhh ǥѴ. ⼭ hh ش Ʈ 16 ǥ Ÿ. Ģ ܴ 齽 տ ̴ " \, ׸ C 鹮ڵ(\n, \t )̴.

Ϲ ϴ α .

Common Log Format (CLF)
"%h %l %u %t \"%r\" %>s %b"
ȣƮ Common Log Format
"%v %h %l %u %t \"%r\" %>s %b"
NCSA extended/combined α
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
Referer α
"%{Referer}i -> %U"
Agent () α
"%{User-agent}i"

û ϴ ServerName Listen %v %p Ѵ. α׺м α׷ û ϴ ȣƮ ˱ ȣƮ ã ˰ ʿ ̵ UseCanonicalName ϴ.

top

Ȼ

ϴ ڿܿ ٸ ڰ α ϴ 丮 ȿ ϶.

top

BufferedLogs þ

:Buffer log entries in memory before writing to disk
:
:ּ
:Base
:mod_log_config

Documentation not yet translated. Please see English version of document.

top

CustomLog þ

:α ̸ Ѵ
:CustomLog file|pipe format|nickname [env=[!]environment-variable]
:ּ, ȣƮ
:Base
:mod_log_config

û α׿ 涧 CustomLog þ Ѵ. α ϰ, ȯ溯 Ͽ û Ư¡ α׸ ִ.

α׸ Ҹ ϴ ù° ƱԸƮ ϳ Ѵ.

file
ServerRoot ϸ.
pipe
"|"ڿ α ǥԷ α׷ θ ´.

:

α׷ Ѵٸ α׷ ȴ. root Ѵٸ α׷ root ϹǷ α׷ Ȯ϶.

н ƴ ÷ ϰθ ԷҶ ÷ 齽 ϴ ݵ ؾ Ѵ. Ϲ Ͽ ׻ ϴ .

ι° ƱԸƮ αϿ Ѵ. LogFormat nickname ϰų α format ڿ ִ.

, þ Ȱ Ѵ.

# Ī CustomLog
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common

# ڿ CustomLog
CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b"

° ƱԸƮ  Ǹ, Ư ȯ溯 û α׿ θ Ѵ. û ȯ溯 ǵִٸ (Ȥ 'env=!name' ٸ) û α׿ Ѵ.

mod_setenvif mod_rewrite Ͽ û ȯ溯 ִ. , GIF ׸ û ּ αװ ƴ ٸ αϿ Ϸ,

SetEnvIf Request_URI \.gif$ gif-image
CustomLog gif-requests.log common env=gif-image
CustomLog nongif-requests.log common env=!gif-image

top

GlobalLog þ

:Sets filename and format of log file
:GlobalLog file|pipe|provider format|nickname [env=[!]environment-variable| expr=expression]
:ּ
:Base
:mod_log_config
:Available in Apache HTTP Server 2.4.19 and later

The documentation for this directive has not been translated yet. Please have a look at the English version.

top

LogFormat þ

:αϿ Ѵ
:LogFormat format|nickname [nickname]
⺻:LogFormat "%h %l %u %t \"%r\" %>s %b"
:ּ, ȣƮ
:Base
:mod_log_config

þ α Ѵ.

LogFormat þ ΰ Ѵ. ù° ƱԸƮ Ѱ Ͽ TransferLog þ α Ѵ. ƱԸƮ α ϱ format ϰų, LogFormat þ ̸ (α Īϴ) nickname ִ.

LogFormat þ ι° format nickname Ѵ. ׷ ڿ ϴ LogFormat̳ CustomLog þ ݺؼ ڿ Էϴ nickname ִ. Ī ϴ LogFormat þ ܿ ƹ ʴ´. , Ī ϸ, ϰų ⺻ ʴ´. ׷Ƿ TransferLog þ ʴ´. , LogFormat Ī ٸ Ī ִ. Ī ̸ ۼƮ ȣ(%) ϶.

LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

top

TransferLog þ

:α ġ Ѵ
:TransferLog file|pipe
:ּ, ȣƮ
:Base
:mod_log_config

þ CustomLog þ ƱԸƮ , α ϰų û ǿ α׿ . ֱ (Ī ) LogFormat þ α Ѵ. ̸ ʾҴٸ Common Log Format Ѵ.

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
TransferLog logs/access_log

:  en  |  fr  |  ja  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.
  翻译: