Skip to content

DeNA/aelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

App Engine Logger

Go Report Card GoDoc

This is Logger for App Engine 2nd Generation. App Engine Plain Logger only supports structured logging (ref: https://cloud.google.com/logging/docs/structured-logging), so this does not support logging experience which proprietary App Engine API provided.

How to use

mux := http.NewServeMux()
mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
    ctx := request.Context()
    aelog.Infof(ctx, "some log message")
})

h := middleware.AELogger("ServeHTTP")(mux)

if err := http.ListenAndServe(fmt.Sprintf(":%s", port), h); err != nil {
    panic(err)
}

License

MIT