Attributes
| Attribute | Description |
| buffered | - access 로그 출력 시에 버퍼링 여부. - 기본값은 true 이다. - false로 설정하면 접근 시에 바로 로그 출력. |
| className | |
| condition | |
| conditionIf | |
| conditionUnless | |
| directory | access log가 생성되는 폴더 |
| encoding | |
| fileDateFormat | - access log rotate 주기를 설정. - 기본값은 yyyy-MM-dd로 매일 rotate됨. - 시간별로 하기 위해서는 yyyy-MM-dd.HH 로 수정 |
| ipv6Canonical | |
| locale | |
| maxDays | - 보관일 수. - 기본값은 -1이므로 삭제하지 않음. - 30일로 설정ㅎ하면 30일만 access log 파일 보관. |
| maxLogMessageBufferSize | |
| pattern | access log 포맷 |
| prefix | access log 파일의 접두사 |
| renameOnRotate | |
| requestAttributesEnabled | |
| resolveHosts | |
| rotatable | - access log 파일을 rotate 할 것인지 여부. - 기본값은 true. - false로 설정하면 rotate 하지 않음. |
| suffix | access log 파일의 접미사 |
pattern
- pattern=”common” : %h %l %u %t “%r” %s %b
- pattern=”combined” : %h %l %u %t “%r” %s %b “%{Referer}i” “%{User-Agent}i”
| Attribute | Description(Eng) | Description(Kor) |
| %a | Remote IP address. See also %{xxx}a below. | Remote IP 주소 |
| %A | Local IP address | 로컬 IP 주소 |
| %b | Bytes sent, excluding HTTP headers, or '-' if zero | 전송된 바이트 수 (헤더는 제외), 0바이트인 경우는 '-'이 표시된다. |
| %B | Bytes sent, excluding HTTP headers | 전송된 바이트 수 (헤더는 제외) |
| %h | Remote host name (or IP address if enableLookups for the connector is false) | Remote 호스트 이름 |
| %H | Request protocol %l - Remote logical username from identd (always returns '-') | 요청 프로토콜 |
| %l(소문자엘) | Remote logical username from identd (always returns '-') | identd의 요청 사용자 이름 (항상 '-'을 반환) |
| %m | Request method (GET, POST, etc.) | 요청 방식 (GET, POST) |
| %p | Local port on which this request was received. See also %{xxx}p below. | 로컬 포트 |
| %q | Query string (prepended with a '?' if it exists) | 쿼리 문자열 (앞에 '?'가 붙는다) |
| %r | First line of the request (method and request URI) | 요청의 첫번째 줄 (메소드와 요청 URI) |
| %s | HTTP status code of the response | HTTP 상태코드 |
| %S | User session ID | 사용자 세션 ID |
| %t | Date and time, in Common Log Format | 요청한 시간과 날짜 |
| %u | Remote user that was authenticated (if any), else '-’ | 인증이 요청된 Remote 사용자 이름('-') |
| %U | Requested URL path | 요청된 URL |
| %v | Local server name | 로컬 서버 이름 |
| %V | UseCanonicalName 따른 서버명 | |
| %D | Time taken to process the request in millis. | 요청이 처리되는데 소요된 시간 (ms) |
| %T | Time taken to process the request, in seconds. | 요청이 처리되는데 소요된 시간 (s) |
| %F | Time taken to commit the response, in milliseconds | |
| %I(대문자아이) | Current request thread name (can compare later with stacktraces) | 현재 요청 스레드의 이름 |
| %X | Connection status when response is completed: 1) X = Connection aborted before the response completed. 2) + = Connection may be kept alive after the response is sent. 3) - = Connection will be closed after the response is sent. |
- 연결상태 1) X = 응답을 마치기 전에 연결이 끊어졌다. 2) + = 응답을 보낸 후에도 연결이 살아있다. (keep alive) 3) - = 응답을 보낸 후 연결이 끊어졌다. |
| %{쿠키명}c | write value of cookie with name xxx (escaped if required) | 요청에 포함된 쿠키값 |
| %{환경변수명}e | 환경변수의 값 | |
| %{헤더명}i | write value of incoming header with name xxx (escaped if required) | 요청에 포함된 헤더명 값 |
| %{헤더명}o | write value of outgoing header with name xxx (escaped if required) | 응답에 포함된 헤더명 값 |
| %{메모}n | 모듈에서 반환한 메모의 값 | |
| %{포멧}t | write timestamp at the end of the request formatted using the enhanced SimpleDateFormat pattern xxx | 포맷된 시간 |
📖 Reference
- https://ssd0908.tistory.com/entry/아파치Apache와-톰캣Tomcat의-차이점-및-이해1
- ❗https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Logging
- https://m.blog.naver.com/solinsystem/221796167356
- https://araikuma.tistory.com/801
- https://blueyikim.tistory.com/1838
- https://sarc.io/index.php/httpd/1094-apache-http-server-log-format
728x90
반응형