🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/ajays20078/go-http-async-logger

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/ajays20078/go-http-async-logger

v0.0.0-20150206121352-46d6e7005d60
Version published
Created

go-http-logger

go-http-logger is a asynchronous non-blocking logger for go HTTP Server which logs the requests in the below format

%YYYY/MM/DD% %HH:MM:SS% %VirtualHost:Port% %ClientHost:Port% "%HttpMethod% %URL?Paramaters% %HttpVersion%" %HttpReturnCode% %ResponseByteSize% "%HttpClient%" %ResponseTime%

Where ResponseTime is in MilliSeconds

It takes the following arguments:

  • request - HTTP request from the client
  • return_status - HTTP return status from the server
  • return_string - HTTP response string
  • file_handler - File to which Log has to be written to
  • start_time - localtime in Nanoseconds (You can use time.Now().UnixNano()) when the HTTP handler starts its execution
  • end_time - localtime in Nanoseconds (You can use time.Now().UnixNano()) when the HTTP handler finishes its execution

FAQs

Package last updated on 06 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts