Skip to content

Simple Go net/http compatible middleware for Apache style logging

License

Notifications You must be signed in to change notification settings

h2non/apachelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apachelog Build Status GoDoc

Go net/http compatible middleware for Apache style logging. Simple. Small. Dependency free.

Originally taken from imaginary package, now isolated as standalone package for better reusability.

Installation

go get gopkg.in/h2non/apachelog.v0

Usage

package main

import (
  "fmt"
  "gopkg.in/h2non/apachelog.v0"
  "net/http"
  "os"
)

func main() {
  mux := http.NewServeMux()

  // Sample route
  mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    w.Write([]byte("Hello World"))
  })

  handler := apachelog.New(mux, os.Stdout)

  fmt.Println("Server listening on port: 3000")
  http.ListenAndServe(":3000", handler)
}

API

Please, see godoc reference.

License

MIT - Tomas Aparicio

About

Simple Go net/http compatible middleware for Apache style logging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages