[Question] Configuring loguru in a library that pre-configure main logger
See original GitHub issueI have a use case of deploying many microservices on multiple cloud provider environments (gcp, aws, azure)
Some of those Cloud Providers requires your applications to format logs in such a way so that it can be parsed automatically by other services. For example, Error Reporting in GCP requires a dedicated structure of logs to group exceptions and stacktraces.
I was wondering how to configure loguruās logger
in that case.
-
Should I create a library that contains only format functions and let each microservice configure itās own instance of
loguru.logger
? -
Should I preconfigure inside the library itself
loguru.logger
andimport
it directly in the apps? If so, were do I import it? In the root module__init__
?
I am more likely to go for solution 2. but advices would be awesome!
I read both the README and the docs but I couldnāt find an answer for this. If you find this use case interesting, I am more than happy to add it to the docs afterwards!
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Great! As it seems solved Iām closing this issue then. š
Perfect! Super clear now. š