log timestamp timezone in mysql-5.7

mysql-5.7 사용중에 sql에 의한 time은 시스템 시간과 동일하게 잘 맞는데..

log(error, slow 등)파일의 timestamp만 내가 사용하는 KST 가 적용되지 않고

9시간 전인 UTC로 되어있다 이말이지…

그래서 찾아봤더니.. 5.7.2 부터 log_timestamps 가 추가되었데… ㅅㅂ

기본값이 UTC설정이라

log_timestamps=SYSTEM

이렇게 처리를 해줘야 한댄다…

 

출처 : http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_log_timestamps

log_timestamps

Introduced 5.7.2
Command-Line Format --log_timestamps=#
System Variable Name log_timestamps
Variable Scope Global
Dynamic Variable Yes
Permitted Values Type enumeration
Default UTC
Valid Values UTC
SYSTEM

This variable controls the timestamp time zone of error log messages, and of general query log and slow query log messages written to files. It does not affect the time zone of general query log and slow query log messages written to tables (mysql.general_log, mysql.slow_log). Rows retrieved from those tables can be converted from the local system time zone to any desired time zone with CONVERT_TZ() or by setting the session time_zone system variable.

Permitted log_timestamps values are UTC (the default) and SYSTEM (local system time zone).

Timestamps are written using ISO 8601 / RFC 3339 format: YYYY-MM-DDThh:mm:ss.uuuuuu plus a tail value of Z signifying Zulu time (UTC) or ±hh:mm (an offset from UTC).

This variable was added in MySQL 5.7.2. Before 5.7.2, timestamps in log messages were written using the local system time zone by default, not UTC. If you want the previous log message time zone default, set log_timestamps=SYSTEM.

 

 

About KENNETH 19688 Articles
지락문화예술공작단

1 Comment

봉봉에 답글 남기기 응답 취소

Your email address will not be published.


*


이 사이트는 스팸을 줄이는 아키스밋을 사용합니다. 댓글이 어떻게 처리되는지 알아보십시오.