Intro to Apache - ApacheCon
Custom logs - formats
    
     %%       The percent sign (Apache 2.0.44 and later)
     %...a    Remote IP-address
     %...A    Local IP-address
     %...B    Size of response in bytes, excluding HTTP headers.
     %...b    Size of response in bytes, excluding HTTP headers. In CLF format, i.e.
              a '-' rather than a 0 when no bytes are sent.
     %...{CookieName}C
              The contents of cookie CookieName in the request sent
              to the server.
     %...D    The time taken to serve the request, in microseconds.
     %...{VARIABLE}e
              The contents of the environment variable VARIABLE
     %...f    Filename
     %...h    Remote host
     %...H    The request protocol
     %...{HEADER}i
             The contents of HEADER: header line(s)
             in the request sent to the server.
     %...l    Remote logname (from identd, if supplied). This will return a
              dash unless IdentityCheck is set On.
     %...m    The request method
     %...{NoteName}n
              The contents of note NoteName from another module.
     %...{HEADER}o
              The contents of HEADER: header line(s) in the reply.
     %...p    The canonical port of the server serving the request
     %...P    The process ID of the child that serviced the request.
     %...{format}P
              The process ID or thread id of the child that serviced the 
             request.  Valid formats are pid and tid.
     %...q    The query string (prepended with a ? if a query
              string exists, otherwise an empty string)
     %...r    First line of request
     %...s   Status. For requests that got internally redirected, this is
             the status of the *original* request --- %...>s
             for the last.
     %...t   Time the request was received (standard english format)
     %...{format}t
             The time, in the form given by format, which should be in
             strftime(3) format. (potentially localized)
     %...T   The time taken to serve the request, in seconds.
     %...u   Remote user (from auth; may be bogus if return status
             (%s) is 401)
     %...U   The URL path requested, not including any query string.
     %...v   The canonical ServerName of the server serving the request.
     %...V   The server name according to the UseCanonicalName setting.
     %...X   Connection status when response is completed:
             X = connection aborted before the response completed.
             + = connection may be kept alive after the response is sent.
             - = connection will be closed after the response is sent.
     %...I   Bytes received, including request and headers, cannot be zero.
             You need to enable mod_logio to use this.
     %...O   Bytes sent, including headers, cannot be zero. You need to
             enable mod_logio to use this.
     
    =Custom log - examples
    
      
    
         LogFormat "%h %l %u %t \"%r\" %>s %b" common
         LogFormat "%{Referer}i -> %U" referer
         LogFormat "%{User-agent}i" agent
    
      
Index
Back to Custom logs
Forward to Extended log format

ApacheCon : Intro to Apache - Slide #130 of 139