Documentation ¶
Index ¶
- func AuthMiddleware(next http.Handler) http.Handler
- func ExampleContextExtractorTraceContext()
- func ExampleContextExtractorUserContext()
- func ExampleDevelopment()
- func ExampleSlogWithZlogHandler()
- func ExampleStacktrace()
- func ExampleTimeFormatter()
- func ExampleZlogLogger()
- func LogMiddleware(log *zlog.Logger, next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExampleContextExtractorTraceContext ¶
func ExampleContextExtractorTraceContext()
This example shows how to use the context, and print OpenTelemetry trace in log. If you have an api server that supports OpenTelemetry, you can use this example in your handler middleware and print trace in each log.
func ExampleContextExtractorUserContext ¶
func ExampleContextExtractorUserContext()
The following is an example of printing a user request in http server. The log contains user information and can be used as an audit log.
func ExampleDevelopment ¶
func ExampleDevelopment()
func ExampleSlogWithZlogHandler ¶
func ExampleSlogWithZlogHandler()
func ExampleStacktrace ¶
func ExampleStacktrace()
func ExampleTimeFormatter ¶
func ExampleTimeFormatter()
func ExampleZlogLogger ¶
func ExampleZlogLogger()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.