mirror of
https://github.com/documize/community.git
synced 2025-07-19 05:09:42 +02:00
improved event logging
This commit is contained in:
parent
92eca1a1ce
commit
2d5b8e652f
13 changed files with 1882 additions and 4 deletions
|
@ -83,6 +83,8 @@ func SaveSMTPConfig(w http.ResponseWriter, r *http.Request) {
|
|||
request.ConfigSet("SMTP", config)
|
||||
|
||||
util.WriteSuccessEmptyJSON(w)
|
||||
|
||||
p.RecordEvent(entity.EventTypeSystemSMTP)
|
||||
}
|
||||
|
||||
// GetLicense returns product license
|
||||
|
|
|
@ -556,8 +556,9 @@ const (
|
|||
EventTypeUserDelete EventType = "removed-user"
|
||||
EventTypeUserPasswordReset EventType = "reset-user-password"
|
||||
EventTypeAccountAdd EventType = "added-account"
|
||||
EventTypeSystemLicense EventType = "changed-license"
|
||||
EventTypeSystemAuth EventType = "changed-auth-config"
|
||||
EventTypeSystemLicense EventType = "changed-system-license"
|
||||
EventTypeSystemAuth EventType = "changed-system-auth"
|
||||
EventTypeSystemSMTP EventType = "changed-system-smtp"
|
||||
EventTypeSessionStart EventType = "started-session"
|
||||
EventTypeSearch EventType = "searched"
|
||||
)
|
||||
|
|
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/documize/community/core/api/entity"
|
||||
"github.com/documize/community/core/log"
|
||||
"github.com/documize/community/core/utility"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// AddAccount inserts the given record into the datbase account table.
|
||||
|
@ -30,14 +31,14 @@ func (p *Persister) AddAccount(account entity.Account) (err error) {
|
|||
defer utility.Close(stmt)
|
||||
|
||||
if err != nil {
|
||||
log.Error("Unable to prepare insert for account", err)
|
||||
errors.Wrap(err, "Unable to prepare insert for account")
|
||||
return
|
||||
}
|
||||
|
||||
_, err = stmt.Exec(account.RefID, account.OrgID, account.UserID, account.Admin, account.Editor, account.Active, account.Created, account.Revised)
|
||||
|
||||
if err != nil {
|
||||
log.Error("Unable to execute insert for account", err)
|
||||
errors.Wrap(err, "Unable to execute insert for account")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue