mattermost / mattermost-plugin-msteams

MS Teams plugin for Mattermost
Other
13 stars 11 forks source link

[MM-57702] Add RequestIDs+TS in msgraph client errors #625

Closed JulienTant closed 4 months ago

JulienTant commented 5 months ago

Summary

Add RequestIDs (client request id + response request id) and timestamp in our logs as recommended by MS

I tried it by creating a broken command:

func (p *Plugin) executeErrAPI(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) {
    user, err := p.GetClientForApp().GetUser("invalid")
    if err != nil {
        p.GetAPI().LogWarn("Error in getting user", "error", err.Error())
        return p.cmdError(args, "Error in getting user")
    }
    return p.cmdSuccess(args, fmt.Sprintf("User: %v", user))
}

Ticket Link

https://mattermost.atlassian.net/browse/MM-57702

JulienTant commented 5 months ago

@jespino gentle ping!