0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

NGINX(初期状態)のログフォーマット及び項目一覧表

0
Posted at

NGINXの初期状態のログフォーマットは、通常以下のようなlog_formatディレクティブで定義されています。

log_format combined '$remote_addr - $remote_user [$time_local] "$request" '
                    '$status $body_bytes_sent "$http_referer" '
                    '"$http_user_agent" "$http_x_forwarded_for"';

このフォーマットに基づいて、各項目の意味を表形式で説明します。

項目 説明
$remote_addr クライアントのIPアドレスを表示します。
$remote_user クライアントがHTTP認証を使ってアクセスした際のユーザー名を表示します。
$time_local サーバーのローカル時刻でリクエストを受信した日時を表示します。
$request リクエストのメソッド、URI、およびHTTPバージョンを含みます(例:GET /
$status リクエストの処理結果のHTTPステータスコードを表示します(例:200、404など)。
$body_bytes_sent ヘッダを除いたレスポンスボディのサイズ(バイト数)を表示します。
$http_referer リクエストのリファラーヘッダの内容を表示します。
$http_user_agent
$http_x_forwarded_for クライアントがプロキシ経由でアクセスした際の元のIPアドレスを表示します(通常はプロキシサーバーが設定)。

この形式は一般的に「combined(組み合わせ)」フォーマットと呼ばれ、Apache HTTP Serverでも類似の形式が使用されています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?