diff --git a/text/2021-12-09-logging.md b/text/2021-12-09-logging.md index 086cf09..b637ccf 100644 --- a/text/2021-12-09-logging.md +++ b/text/2021-12-09-logging.md @@ -120,6 +120,17 @@ func doSomething() { > As you could see, it is actually a closure with an extern/global state. +With application using dependency injection framework (like `fx`), depends on +the different patterns for bootstrapping the application, there are several ways +to bootstrap the initialization of logger: + +- if only root logger is provided into dependency injection framework, using + another method that wraps the original constructor with the logic for setting + the logger name +- if various loggers are provided into dependency injection framework, using + another method that wraps the original constructor with "Named Values" feature + to inject the logger with a certain name. + ### Logging in Chaos Mesh Dashboard and gin Chaos Mesh Dashboard use [gin](https://github.com/gin-gonic/gin) as thew web