Tracking Push Notifications in a structured logger (notifications.log) (#10823)

* Remove NotificationRegistry table and use structured logging

* Fix ackId for notification sent

* Notification logger at server level

* Remove unused i18n strings
Этот коммит содержится в:
Elias Nahum
2019-05-13 10:53:46 -04:00
коммит произвёл Christopher Speller
родитель 30061df036
Коммит 5b252e8736
23 изменённых файлов: 206 добавлений и 578 удалений

Просмотреть файл

@@ -308,16 +308,13 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
)
} else {
// register that a notification was not sent
notificationRegistry := model.NotificationRegistry{
UserId: id,
PostId: post.Id,
SendStatus: model.PUSH_NOT_SENT,
Type: model.PUSH_TYPE_MESSAGE,
}
_, appErr := a.Srv.Store.NotificationRegistry().Save(&notificationRegistry)
if appErr != nil {
mlog.Debug(appErr.Error())
}
a.NotificationsLog.Warn("Notification not sent",
mlog.String("ackId", ""),
mlog.String("type", model.PUSH_TYPE_MESSAGE),
mlog.String("userId", id),
mlog.String("postId", post.Id),
mlog.String("status", model.PUSH_NOT_SENT),
)
}
}
@@ -343,16 +340,13 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
)
} else {
// register that a notification was not sent
notificationRegistry := model.NotificationRegistry{
UserId: id,
PostId: post.Id,
SendStatus: model.PUSH_NOT_SENT,
Type: model.PUSH_TYPE_MESSAGE,
}
_, appErr := a.Srv.Store.NotificationRegistry().Save(&notificationRegistry)
if appErr != nil {
mlog.Debug(appErr.Error())
}
a.NotificationsLog.Warn("Notification not sent",
mlog.String("ackId", ""),
mlog.String("type", model.PUSH_TYPE_MESSAGE),
mlog.String("userId", id),
mlog.String("postId", post.Id),
mlog.String("status", model.PUSH_NOT_SENT),
)
}
}
}