Discover Packages
github.com/emahiro/ae-plain-logger
module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Aug 15, 2019
License: MIT
Opens a new window with license information.
README
README
¶
App Engine Plain Logger
This is Plain 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()
log.Infof(ctx, "some log message)
})
h := middleware.AEPlainLogger("ServeHTTP")(mux)
if err := http.ListenAndServe(fmt.Sprintf(":%s", port), h); err != nil {
panic(err)
}
License
MIT
Expand ▾
Collapse ▴
Directories
¶
internal
Package log provides the structured log of an application's logs from within an App Engine application.
Package log provides the structured log of an application's logs from within an App Engine application.
Package middleware provides the http.Handler with spancontext.
Package middleware provides the http.Handler with spancontext.
Click to show internal directories.
Click to hide internal directories.