[Update] Logger
This commit is contained in:
parent
0a74a2c031
commit
5d864de6ce
|
@ -2,8 +2,8 @@ package audit
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.selly.red/Selly-Modules/logger"
|
|
||||||
"git.selly.red/Selly-Modules/mongodb"
|
"git.selly.red/Selly-Modules/mongodb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -47,10 +47,6 @@ func (s Service) Create(payload CreatePayload) {
|
||||||
// Insert to db
|
// Insert to db
|
||||||
colName := getColName(payload.Target)
|
colName := getColName(payload.Target)
|
||||||
if _, err := s.DB.Collection(colName).InsertOne(ctx, doc); err != nil {
|
if _, err := s.DB.Collection(colName).InsertOne(ctx, doc); err != nil {
|
||||||
logger.Error("audit - Create", logger.LogData{
|
fmt.Println("audit - Create", err.Error())
|
||||||
Source: "audit.action_create.Create",
|
|
||||||
Message: err.Error(),
|
|
||||||
Data: payload,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
go.mod
1
go.mod
|
@ -3,7 +3,6 @@ module git.selly.red/Selly-Modules/audit
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c // indirect
|
|
||||||
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 // indirect
|
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 // indirect
|
||||||
github.com/go-stack/stack v1.8.1 // indirect
|
github.com/go-stack/stack v1.8.1 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1,7 +1,3 @@
|
||||||
git.selly.red/Selly-Modules/logger v0.0.2 h1:ZchJbOBN26K11qmfgCtkF2eO2h7ldIKGG5SbQzmgBEE=
|
|
||||||
git.selly.red/Selly-Modules/logger v0.0.2/go.mod h1:kvXfyQNzXgdHfbocMCtUssRXicVKdwJahAKLKMJD1uU=
|
|
||||||
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c h1:eqGjWFibI3/7ovg9fGBx//E/I2HyydnkstphghcLiQI=
|
|
||||||
git.selly.red/Selly-Modules/logger v0.0.3-0.20221010034051-82b204026f8c/go.mod h1:q1q2tXmja+vOKo3IU7qZhRXaEBB5jETxHqUlYHsAUEQ=
|
|
||||||
git.selly.red/Selly-Modules/mongodb v1.0.4 h1:zAtqmW+RLnNpAlB+bu2s7FE02D9AuptFjjx9KrbStRI=
|
git.selly.red/Selly-Modules/mongodb v1.0.4 h1:zAtqmW+RLnNpAlB+bu2s7FE02D9AuptFjjx9KrbStRI=
|
||||||
git.selly.red/Selly-Modules/mongodb v1.0.4/go.mod h1:OhqdqYqh8WqEEruz6U27Wu1kKoBLwIUQsc+56xl0Wcs=
|
git.selly.red/Selly-Modules/mongodb v1.0.4/go.mod h1:OhqdqYqh8WqEEruz6U27Wu1kKoBLwIUQsc+56xl0Wcs=
|
||||||
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 h1:bePzcMN/j4V1fvz6UUrN01ey1tkE0w+m5Qj3LtoZs4E=
|
git.selly.red/Selly-Modules/mongodb v1.0.6-0.20221010033754-1d897a0f9ea2 h1:bePzcMN/j4V1fvz6UUrN01ey1tkE0w+m5Qj3LtoZs4E=
|
||||||
|
|
Loading…
Reference in New Issue