Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure(config interfaces.AppConfig) (*zap.Logger, error)
Configure Setup zap logging and return the root logger.
func ZapFieldsFromContext ¶
ZapFieldsFromContext Extract public fields from the context and return them as a list of zap.Field objects.
This is to make structured logging work well. In the body of request handlers, the following code can be used to attach request-related data to the route logger:
```
func LoginHandler(req interfaces.RequestContext) *views.Response { logger := req.Logger().With(logging.ZapFieldsFromContext(req.Context())) // now, the request id and other metadata will automatically be included in future logs }
```
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.