logging tweaks (#2663)

#### Does this PR need a docs update or release note?

- [x]  No

#### Type of change

- [ ] 🐛 Bugfix

#### Issue(s)

* #1970

#### Test Plan

- [x]  Unit test
This commit is contained in:
Keepers 2023-02-27 14:29:20 -07:00 committed by GitHub
parent 896a9cfeba
commit ebf597b31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -324,7 +324,9 @@ func (handler *LoggingMiddleware) Intercept(
"response", string(respDump),
)
} else if resp.StatusCode/100 != 2 {
logger.Ctx(ctx).Infow("graph api error", "status", resp.Status, "method", req.Method, "url", req.URL)
logger.Ctx(ctx).
With("status", resp.Status, "method", req.Method, "url", req.URL).
Infof("graph api error: %s", resp.Status)
}
}

View File

@ -138,7 +138,8 @@ func (op *RestoreOperation) Run(ctx context.Context) (restoreDetails *details.De
ctx,
"tenant_id", op.account.ID(), // TODO: pii
"backup_id", op.BackupID,
"service", op.Selectors.Service)
"service", op.Selectors.Service,
"destination_container", op.Destination.ContainerName)
// -----
// Execution