https://github.com/dena/aelog
App Engine Logger
https://github.com/dena/aelog
appengine appengine-go go
Last synced: 28 days ago
JSON representation
App Engine Logger
- Host: GitHub
- URL: https://github.com/dena/aelog
- Owner: DeNA
- License: mit
- Created: 2019-08-09T08:40:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T06:50:46.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T15:12:57.588Z (11 months ago)
- Topics: appengine, appengine-go, go
- Language: Go
- Homepage:
- Size: 59.6 KB
- Stars: 24
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# App Engine Logger
[](https://goreportcard.com/report/github.com/DeNA/aelog)
[](https://godoc.org/github.com/DeNA/aelog)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](https://cloud.google.com/logging/docs/structured-logging)), so this does not support logging experience which proprietary App Engine API provided.## How to use
```go
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