When initializing or creating an Azure repository, adjust the log output to JSON format

Signed-off-by: hu-keyu <hzldd999@gmail.com>
pull/8846/head^2
hu-keyu 2025-04-07 16:24:01 +08:00
parent 5160f96c2e
commit 9ebca79754
1 changed files with 8 additions and 1 deletions

View File

@ -56,7 +56,14 @@ func (s *Storage) ConnectionInfo() blob.ConnectionInfo {
func NewStorage(ctx context.Context, option *Option, isCreate bool) (blob.Storage, error) {
cfg := option.Config
client, _, err := azureutil.NewStorageClient(logrus.New(), cfg)
logger := logrus.New()
logger.Formatter = &logrus.JSONFormatter{
FieldMap: logrus.FieldMap{
logrus.FieldKeyMsg: "@message",
},
DisableTimestamp: false,
}
client, _, err := azureutil.NewStorageClient(logger, cfg)
if err != nil {
return nil, err
}