Skip to content

Commit

Permalink
fix(data): discard gorm logs
Browse files Browse the repository at this point in the history
Default Gorm logger may contain sensitive information so in lieu of
implementing a custom logger that can filter log statements, discard all
logs. Custom logger will be implemented in #1189
  • Loading branch information
mxyng committed Mar 15, 2022
1 parent 4880990 commit fe7ec71
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions internal/server/data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package data
import (
"errors"
"fmt"
"log"
"os"
"path"
"strings"
"time"

"github.com/go-playground/validator/v10"
"github.com/jackc/pgconn"
Expand All @@ -24,15 +22,7 @@ import (

func NewDB(connection gorm.Dialector) (*gorm.DB, error) {
db, err := gorm.Open(connection, &gorm.Config{
Logger: logger.New(
log.New(os.Stdout, "\r\n", log.LstdFlags),
logger.Config{
SlowThreshold: time.Second,
LogLevel: logger.Warn,
IgnoreRecordNotFoundError: true,
Colorful: true,
},
),
Logger: logger.Discard,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit fe7ec71

Please sign in to comment.