Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include time format with millisecond precision in Apache access log

How to include time format with millisecond precision in Apache Access Log.

I tried to use:

pattern="%h %l %u %{%d/%b/%Y %T}t.%{msec_frac}t %{%z}t "%r" %s %b".

However it does not work.

like image 420
Rakshith R Pai Avatar asked Oct 06 '16 12:10

Rakshith R Pai


Video Answer


1 Answers

From the AccessLogValve documentation

%{xxx}t xxx is an enhanced SimpleDateFormat pattern

So if you use a pattern of something like %{yyyy-MM-dd HH:mm:ss.SSS}t then it should print milliseconds.

like image 78
Magnus Avatar answered Oct 11 '22 09:10

Magnus