ziflex / lecho

Zerolog wrapper for Echo framework 🍅
MIT License
98 stars 11 forks source link

Support nesting request metrics under a sub dictionary #14

Closed tdevelioglu closed 2 years ago

tdevelioglu commented 2 years ago

In some cases you don't want the fields of the request metrics directly in the root of the dictionary.

For example, when sending general application logs and request metric logs to the same ES index it's good to be able to to nest the request metrics as a separate object.

This commit adds 1 extra config option NestKey holding the name of a key, that when set will nest the request metric fields in a sub dictionary under the key name.

ziflex commented 2 years ago

Hey, sorry for the late response. The PR looks good, but can we use a slightly shorter name of the new param?

tdevelioglu commented 2 years ago

Hey, sorry for the late response. The PR looks good, but can we use a slightly shorter name of the new param?

Changed to NestKey, please let me know if you prefer something else.