Transforms a Hapi request to a Common Log Format log line
npm install @sequencemedia/hapi-common-log@sequencemedia/hapi-common-logTransforms a Hapi request to a Common Log Format log line.
``js
import toCommonLog from '@sequencemedia/hapi-common-log';
server.events.on('response', (request) => {
console.log(toCommonLog(request))
})
`
From Wikipedia:
> ```
> 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
>
>
> A "-" in a field indicates missing data.
>
> * _127.0.0.1_ is the IP address of the client (remote host) which made the request to the server.
> * _user-identifier_ is the RFC 1413 identity of the client. Usually "-".
> * _frank_ is the userid of the person requesting the document. Usually "-" unless .htaccess has requested authentication.
> * _[10/Oct/2000:13:55:36 -0700]_ is the date, time, and time zone that the request was received, by default in strftime format _%d/%b/%Y:%H:%M:%S %z_.
> * _"GET /apache_pb.gif HTTP/1.0"_ is the request line from the client. The method _GET_, _/apache_pb.gif_ the resource requested, and _HTTP/1.0_ the HTTP protocol.
> * _200_ is the HTTP status code returned to the client. 2xx is a successful response, 3xx a redirection, 4xx a client error, and 5xx a server error.
> * _2326_ is the size of the object returned to the client, measured in bytes.
ISC