Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

So basic question, but I can't seem to find an easy answer.

How do I record the date/time in my apache logs to have a unix timestamp (seconds since epoch).

I have the default LogFormat as:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
share|improve this question

1 Answer 1

Apache Module mod_log_config:

%{format}t  The time, in the form given by format, which should be in strftime(3) format. (potentially localized)


    LogFormat "%v %h %l %u %{%s}t \"%r\" %>s %b" vhost_common
    CustomLog /var/log/test vhost_common

Log: - - 1309405372 "GET / HTTP/1.0" 200 177
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.