go-zap Questions

3

Solved

I created a logger with kubebuilder, it is based on zap logger: import ( "flag" "github.com/gin-gonic/gin" "net/http" "os" "go.uber.org/zap/zapcore...
Stampede asked 27/10, 2021 at 11:56

2

Given the following code (copied from here): 1 package main 2 3 import ( 4 "fmt" 5 6 "github.com/pkg/errors" 7 8 "go.uber.org/zap" 9 ) 10 11 func main()...
Immaterialize asked 27/11, 2020 at 18:34

4

I have integrated Zap with my go application, we have logs getting printed in two log files and i am also using Lumberjack for log rotation. But i am trying to display the logs in console as well, ...
Unsteady asked 19/6, 2018 at 17:29

3

Currently, our project's log format is like: www.abcdef.com`3`1s I want to use Go to rewrite project and import zap as log tool. By zap the log's format is like: {"url": "www.abcdef.com", "atte...
Malay asked 11/9, 2018 at 10:58

4

Solved

I'm trying to migrate my application from the beautiful Logrus (very helpful for debug) and introducing the Uber log framework Zap. With Logrus, I can initialize the logger only once and reuse it f...
Sandstrom asked 1/9, 2019 at 10:3

3

How to configure uber-go/zap logger api to append logs to a specified file-path. Can it be made to work like rolling file-appender (based on file-size or date) without affecting performance?
Alvira asked 1/8, 2017 at 14:23

2

Solved

I have the following logging structure: [STDERR] 2018-07-09 11:06:16.003 INFO some_pkg/main.go:232 Logging message 1 {"pid": 8842, "process": "some_process"} [STDERR] ...
Vigue asked 9/7, 2018 at 11:48

1

Solved

I am trying to set up logging using this package github.com/uber-go/zap. I need to write: Info logs to stdout Error and Fatal logs to stderr I tried to do this by setting up and building zap.Conf...
Weedy asked 21/7, 2021 at 15:49

1

Solved

How to get function name printed in logs from Uber Zap logging ? This is the PR request with which they seemed to have added the functionality to output function names in log. I am using golang ver...
Femoral asked 1/3, 2021 at 23:7

1

I'm creating a custom logger where we can log to std out and std err, but also adding the possibility to log to kafka (the code example is here: https://github.com/roppa/kafka-go). We have multiple...
Euthenics asked 9/12, 2020 at 15:40

2

Solved

I have a Zap logger that is generated from a custom Config (i.e. config.Build()). I would like to test the logger by calling, for example, logger.Info() in the test method and assert the result to ...
Bog asked 10/10, 2018 at 7:6

1

I started using the zap log library for my Go project. I want to print different colors to tty console based on the log level. I find the zap/internal/color package can display different colors for...
Scutage asked 30/3, 2017 at 16:49
1

© 2022 - 2024 — McMap. All rights reserved.