im trying to get logrus to read from viper.
Using the recommendation library in logrus below.
im trying to setup my config in a grouped way.
like logging: all its properties in yml format
i’m unsure how to get this to work since the examples make it look like its not possible
package logrusHelper_Test
// there is a bug in go < 1.9 with test only package and name, bug on namespace, we need to break recognition...
import (
"testing"
"fmt"
"os"
"github.com/heirko/go-contrib/logrusHelper"
_ "github.com/heralight/logrus_mate/hooks/file"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"time"
. "github.com/smartystreets/goconvey/convey"
)
func initLogger() {
This file has been truncated. show original
my properties file:
app:
port: 80
name: testappsvcliv
db:
enable: “N”
driver: pgx
url: postgres://postgres:postpass@localhost/pqgotest
max-open: 5
max-idle: 0
max-timeout: 100ms
logging:
Added a issue tracker with solution since branch creation permissions aren’t available on that repo.
alternatively you can write the function yourself in your codebase without waiting for that to be absorbed into the library
system
(system)
Closed
September 22, 2020, 11:16am
3
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.