graniticio / granitic

Web/micro-services and IoC framework for Golang developers
https://granitic.io/
Apache License 2.0
35 stars 12 forks source link

Allow context data in access and application logs #42

Closed benhalstead closed 5 years ago

benhalstead commented 5 years ago

It is common to store meta-data about a web service request in a context.Context and also common to want to log this information in access logs and application log prefixes.

It unsafe to provide direct access to contexts (i.e. read information directly out of the context) and also not possible if the keys to the context value is not a string.

Instead Granitic will support a new interface which will allow applications to create a component that provides a limited view of context data as a extension of map[string]string