geniusjoe commented on code in PR #1449:
URL: https://github.com/apache/pulsar-client-go/pull/1449#discussion_r2619824973
##########
examples/producer/producer.go:
##########
@@ -20,40 +20,58 @@ package main
import (
"context"
"fmt"
- "log"
+ "io"
+ "log/slog"
+ "os"
"github.com/apache/pulsar-client-go/pulsar"
+ pulsarlog "github.com/apache/pulsar-client-go/pulsar/log"
+ "gopkg.in/natefinch/lumberjack.v2"
)
func main() {
+ fileLogger := &lumberjack.Logger{
+ Filename: "/tmp/pulsar-go-sdk.log",
+ MaxSize: 100,
+ MaxBackups: 5,
+ LocalTime: true,
+ }
+ // this multiLogger both print log to stdout and fileLogger
+ // if only want to print log to file, just pass fileLogger to
slog.NewJSONHandler()
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]