By default pegasus-go-client logs to “./pegasus.log” on where your application runs.
You can customize the logging rules as follows:
// customize where the pegasus-go-client's logs reside.
pegalog.SetLogger(pegalog.NewLogrusLogger(&pegalog.LogrusConfig{
// rotation rules
MaxSize: 500, // megabytes
MaxAge: 5, // days
MaxBackups: 100,
// log files location
Filename: "/home/work/myapp/log/pegasus.log",
}))
To print the logs on screen:
pegalog.SetLogger(pegalog.StderrLogger)
We highly recommend you to enable client logging for debugging purpose. If you want
support for other log destinations or log formats, please submit an issue for that.
pegasus-go-client
This is the official go client for Apache Pegasus.
Requirement
Go1.12+.
Logging
By default pegasus-go-client logs to “./pegasus.log” on where your application runs. You can customize the logging rules as follows:
To print the logs on screen:
We highly recommend you to enable client logging for debugging purpose. If you want support for other log destinations or log formats, please submit an issue for that.
Example
For more examples please refer to example/.
TroubleShooting
Before using pegasus-go-client, it’s recommended to configure GOBACKTRACE so as to generate coredump while program unexpectedly corrupts.