httpLogger

package module
v0.0.0-...-7aaf996 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2016 License: MIT Imports: 4 Imported by: 5

README

go-http-logger

go-http-logger is a wrapper around http handler 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%

It takes the following arguments:

  • request - HTTP request from the client
  • file_handler - File to which Log has to be written to

Syntax:

http.ListenAndServe(Virtual_Host+":"+port, httpLogger.WriteLog(http.DefaultServeMux,fileHandler))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteLog

func WriteLog(handle http.Handler, fileHandler *os.File) http.HandlerFunc

WriteLog Logs the Http Status for a request into fileHandler and returns a httphandler function which is a wrapper to log the requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL