You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "mrproliu (via GitHub)" <gi...@apache.org> on 2023/07/12 02:01:54 UTC
[GitHub] [skywalking-go] mrproliu commented on a diff in pull request #69: Enhance the `logrus` logger plugin to support adapt without any settings method invoke
mrproliu commented on code in PR #69:
URL: https://github.com/apache/skywalking-go/pull/69#discussion_r1260472421
##########
docs/en/advanced-features/logging-setup.md:
##########
@@ -5,6 +5,16 @@ It currently supports the recognition of `Logrus` and `Zap` frameworks. If neith
You can learn about the configuration details through the "log" configuration item in the [default settings](../../../tools/go-agent/config/agent.default.yaml).
+## Logging Detection
+
+Log detection means that the logging plugin would automatically detect the usage of logs in your application.
+When the log type is set to `auto`, it would choose the appropriate log based on the creation rules of different frameworks. The selection rules vary depending on the framework:
+
+1. `Logrus`: It automatically selects the current logger when executing functions such as `logrus.New`, `logger.SetOutput`, or `logger.SetFormatter`.
+2. `Zap`: It automatically selects the current logger when executing functions such as `zap.New`, `zap.NewNop`, `zap.NewProduction`, `zap.NewDevelopment`, or `zap.NewExample`.
+
+If there are multiple different logging systems in your current application, the last-called logging system would be chosen.
Review Comment:
> Multiple logging systems usually mean hybrid logging usage, right?
Yes.
> What does `last-called` mean?
That means which logging system would be used on the agent logging. Hybrid logging usage permits logging uploader and tracing enhancement, but the Go Agent logging only needs to send the log to the one logging system.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org