Structured logging package for Go.

Structured logging for golang

Package log implements a simple structured logging API inspired by Logrus, designed with centralization in mind. Read more on Medium.

Handlers

  • apexlogs – handler for Apex Logs
  • cli – human-friendly CLI output
  • discard – discards all logs
  • es – Elasticsearch handler
  • graylog – Graylog handler
  • json – JSON output handler
  • kinesis – AWS Kinesis handler
  • level – level filter handler
  • logfmt – logfmt plain-text formatter
  • memory – in-memory handler for tests
  • multi – fan-out to multiple handlers
  • papertrail – Papertrail handler
  • text – human-friendly colored output
  • delta – outputs the delta between log calls and spinner

Example

Example using the Apex Logs handler.

package main

import (
	"errors"
	"time"

	"github.com/apex/log"
)

func main() {
	ctx := log.WithFields(log.Fields{
		"file": "something.png",
		"type": "image/png",
		"user": "tobi",
	})

	for range time.Tick(time.Millisecond * 200) {
		ctx.Info("upload")
		ctx.Info("upload complete")
		ctx.Warn("upload retry")
		ctx.WithError(errors.New("unauthorized")).Error("upload failed")
		ctx.Errorf("failed to upload %s", "img.png")
	}
}

Build Status GoDoc

Owner
Apex
Building beautiful solutions
Apex
Comments
  • Ensure WithError doesn't panic

    Ensure WithError doesn't panic

    Hi there! I've been bitten a few times by accidentally passing a nil error to WithError and causing a panic 😢

    This patch modifies the behavior so that instead of panicking, you simply get the unmodified Entry back. Thanks!

  • Allow Trace.Stop(*error) to be called multiple times and only log once

    Allow Trace.Stop(*error) to be called multiple times and only log once

    If you have:

    func (a *API) Check(w http.ResponseWriter, r *http.Request) {
      log := a.log.Trace("check")
      defer log.Stop(nil)
      if err := check(); err != nil {
        log.Stop(&err)
        return
      }
    }
    

    If there's an error, you'll have two log entries for stopping the trace. It'd be great do only log once for the first one.

  • Added custom rule Handler

    Added custom rule Handler

    This Handler allows to filter certain log entries depending on i.e. certain field or some other circumstances.

    A real-life example is to filter some sensitive data from going to centralized logging server on production build, but allow it to go to CLI on dev's local machine for debugging purposes.

    An Or function also provided to ease rule construction.

  • Optionally disable ANSI characters in log output?

    Optionally disable ANSI characters in log output?

    I'm outputting logs to syslog via upstart and the ANSI characters seem to end up garbled. Is there a way to disable ANSI output for the cli or text loggers?

  • Test on all supported versions of go

    Test on all supported versions of go

    This PR allows us to test on all versions of go that the library supports and updates the used action versions so the already fast tests run even faster.

  • Add: log.Flush()

    Add: log.Flush()

    This PR gets the log.Flush() work started. It currently just demonstrates the flow and the API, not the implementation.

    Sorry, I hate receiving WIP PRs because they usually just hang forever, but I'm definitely going to get this one finished up ASAP.

    Could just use a quick review to make sure this is on the right track with what you're looking for, mainly around adding log.Flush() to the top-level API. At first I thought this would be a breaking change, but now I'm not so sure, since I didn't alter the interface at all.

    The rest of the change is just setting up some testing for papertrail and also firehose when I implement it :-)

  • Getting nil pointer references when log.SetHandler(...) is not set

    Getting nil pointer references when log.SetHandler(...) is not set

    Is there anyway to prevent this? I'd love to use this library more like debug (logging within nested packages), seems like the default should be discard.

    Definitely down to open a PR with a bit of direction :-)

    Looks like this:

    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    	panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1d053c]
    
    goroutine 5 [running]:
    panic(0x283620, 0xc42000c0d0)
    	/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:500 +0x1a1
    testing.tRunner.func1(0xc420094180)
    	/usr/local/Cellar/go/1.7.4_1/libexec/src/testing/testing.go:579 +0x25d
    panic(0x283620, 0xc42000c0d0)
    	/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:458 +0x243
    github.com/apex/log.(*Logger).log(0xc420010200, 0x1, 0xc420105988, 0xc420018be0, 0x9e)
    	/Users/matt/go/src/github.com/apex/log/logger.go:125 +0x6c
    github.com/apex/log.(*Entry).Info(0xc420105988, 0xc420018be0, 0x9e)
    	/Users/matt/go/src/github.com/apex/log/entry.go:61 +0x50
    github.com/apex/log.(*Logger).Info(0xc420010200, 0xc420018be0, 0x9e)
    	/Users/matt/go/src/github.com/apex/log/logger.go:68 +0x7f
    github.com/apex/log.Info(0xc420018be0, 0x9e)
    	/Users/matt/go/src/github.com/apex/log/pkg.go:44 +0x49
    
  • Global logger without race conditions

    Global logger without race conditions

    Hi, first off I love the ideas behind apex and apex/log. I wanted to use apex/log in a package of mine, so to use it in multiple files I ended up doing this:

    // logger.go
    var Logger *alog.Entry
    
    func init() {
        alog.SetHandler(text.New(os.Stderr))
        if ios.Getenv("DEBUG") != "" {
            alog.SetLevel(alog.DebugLevel)
        }
        Logger = alog.WithField("program", "super-downloader")
    }
    

    And within the other files I could use it like so:

    // downloader.go
    Logger.Debug("Downloading " + v.ID)
    Logger.Debug("Download started 200 OK")
    

    This worked great until I ran my tests which use t.Parallel() with DEBUG=true resulting in race conditions and the following errors:

    =================
    WARNING: DATA RACE
    Write by goroutine 10:
     DEBUG[0000] getting video metadata     github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:126 +0x8d
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestDownload()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/download_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
    
    Previous write by goroutine 12:
      github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:126 +0x8d
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestFallback()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/fallback_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
     program=super-downloader
    Goroutine 10 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    
    Goroutine 12 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
    
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    ==================
    ==================
    WARNING: DATA RACE
    Write by goroutine 10:
      github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:127 +0xaf
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestDownload()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/download_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
    
    Previous write by goroutine 12:
      github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:127 +0xaf
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestFallback()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/fallback_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
    
    Goroutine 10 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    
    Goroutine 12 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    ==================
    ==================
    WARNING: DATA RACE
    Write by goroutine 10:
      github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:128 +0x124
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestDownload()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/download_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
    
    Previous write by goroutine 12:
      github.com/apex/log.(*Logger).log()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/logger.go:128 +0x124
      github.com/apex/log.(*Entry).Debug()
          /Users/montanaflynn/Development/go/src/github.com/apex/log/entry.go:57 +0x61
      github.com/montanaflynn/downloader.NewVideo()
          github.com/montanaflynn/downloader/_test/_obj_test/video.go:17 +0x9f
      github.com/montanaflynn/downloader.TestFallback()
          /Users/montanaflynn/Development/go/src/github.com/montanaflynn/downloader/fallback_test.go:7 +0x81
      testing.tRunner()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:456 +0xdc
    
    Goroutine 10 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    
    Goroutine 12 (running) created at:
      testing.RunTests()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:561 +0xaa3
      testing.(*M).Run()
          /private/var/folders/vd/7l9ys5k57l91x63sh28wl_kc0000gn/T/workdir/go/src/testing/testing.go:494 +0xe4
      main.main()
          github.com/montanaflynn/downloader/_test/_testmain.go:124 +0x384
    ==================
    
  • adding/removing handlers

    adding/removing handlers

    I am using the apex logs handler, but also a few other handlers, os.Stdout in development, and the json handler writing to a local log file. I have a scenario where when I am exiting my program I want to close the file that json writes to. This could error though, and I want to send that error to the apex logs handler, but I don't want to retry writing that log to the file that failed to close. Is there a way that I could remove the file handler after the error occurs and before I write to apex?

            handlers := []apex.Handler{json.New(file)}
    
    	var apexHandler *apexlogs.Handler
    	if opts.ApexURL != "" && opts.ApexProjectID != "" && opts.ApexAuthToken != "" {
    		apexHandler = apexlogs.New(opts.ApexURL, opts.ApexProjectID, opts.ApexAuthToken)
    		handlers = append(handlers, apexHandler)
    	}
    
    	if opts.IsDev {
    		handlers = append(handlers, text.New(os.Stdout))
            }
            apex.SetHandler(multi.New(handlers...))
    
    	logger = apex.WithFields(versionLogFields()).WithFields(hostInfoLogFields())
    
    	cleanup = func() {
    		if err := file.Close(); err != nil {
                            // Should I call apex.SetHandler(..) here to remove the json handler?
    			logger.WithError(err).Error("log file failed to close")
    		}
    		if apexHandler != nil {
    			apexHandler.Close()
    		}
    	}
    
  • Stringify Duration field in Stop

    Stringify Duration field in Stop

    Currently the duration field in log.Stop is set to be a time.Duration type, which is then formatted by the handlers. see here: https://github.com/apex/log/blob/a0bcece0a725e2b62f01d948b25ba3c22ebfb792/entry.go#L144-L146

    With the JSON handler, this ends up looking like this:

    "duration":1935807,

    Calling .String() on the duration ends up with a more human-readable:

    "duration":"1.935807ms"

    I realize that the JSON handler is meant to be machine-parseable, but think the second is still machine-parseable while being much more human-readable.

    Any thoughts? Would be glad to submit a PR with this change.

  • Why prefix with second value in every log ?

    Why prefix with second value in every log ?

    I want to ask a question : why dose put second time since program start at log pattern .

    Dose it can help us while trace the log ? What is the meaning or target of it ?

    2018-06-05 11 53 03
  • Bump github.com/aws/aws-sdk-go from 1.20.6 to 1.33.0

    Bump github.com/aws/aws-sdk-go from 1.20.6 to 1.33.0

    Bumps github.com/aws/aws-sdk-go from 1.20.6 to 1.33.0.

    Changelog

    Sourced from github.com/aws/aws-sdk-go's changelog.

    Release v1.33.0 (2020-07-01)

    Service Client Updates

    • service/appsync: Updates service API and documentation
    • service/chime: Updates service API and documentation
      • This release supports third party emergency call routing configuration for Amazon Chime Voice Connectors.
    • service/codebuild: Updates service API and documentation
      • Support build status config in project source
    • service/imagebuilder: Updates service API and documentation
    • service/rds: Updates service API
      • This release adds the exceptions KMSKeyNotAccessibleFault and InvalidDBClusterStateFault to the Amazon RDS ModifyDBInstance API.
    • service/securityhub: Updates service API and documentation

    SDK Features

    • service/s3/s3crypto: Introduces EncryptionClientV2 and DecryptionClientV2 encryption and decryption clients which support a new key wrapping algorithm kms+context. (#3403)
      • DecryptionClientV2 maintains the ability to decrypt objects encrypted using the EncryptionClient.
      • Please see s3crypto documentation for migration details.

    Release v1.32.13 (2020-06-30)

    Service Client Updates

    • service/codeguru-reviewer: Updates service API and documentation
    • service/comprehendmedical: Updates service API
    • service/ec2: Updates service API and documentation
      • Added support for tag-on-create for CreateVpc, CreateEgressOnlyInternetGateway, CreateSecurityGroup, CreateSubnet, CreateNetworkInterface, CreateNetworkAcl, CreateDhcpOptions and CreateInternetGateway. You can now specify tags when creating any of these resources. For more information about tagging, see AWS Tagging Strategies.
    • service/ecr: Updates service API and documentation
      • Add a new parameter (ImageDigest) and a new exception (ImageDigestDoesNotMatchException) to PutImage API to support pushing image by digest.
    • service/rds: Updates service documentation
      • Documentation updates for rds

    Release v1.32.12 (2020-06-29)

    Service Client Updates

    • service/autoscaling: Updates service documentation and examples
      • Documentation updates for Amazon EC2 Auto Scaling.
    • service/codeguruprofiler: Updates service API, documentation, and paginators
    • service/codestar-connections: Updates service API, documentation, and paginators
    • service/ec2: Updates service API, documentation, and paginators
      • Virtual Private Cloud (VPC) customers can now create and manage their own Prefix Lists to simplify VPC configurations.

    Release v1.32.11 (2020-06-26)

    Service Client Updates

    • service/cloudformation: Updates service API and documentation
      • ListStackInstances and DescribeStackInstance now return a new StackInstanceStatus object that contains DetailedStatus values: a disambiguation of the more generic Status value. ListStackInstances output can now be filtered on DetailedStatus using the new Filters parameter.
    • service/cognito-idp: Updates service API

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • [question] why `SetLevelFromString` and `SetLevel` are not thread-safe?

    [question] why `SetLevelFromString` and `SetLevel` are not thread-safe?

    I want to reload config and setup global log level dynamically

    But got race conditions could you give any suggestions how to do it?

    WARNING: DATA RACE
    Write at 0x00000532fb30 by goroutine 94:
      github.com/apex/log.SetLevelFromString()
          /root/go/pkg/mod/github.com/apex/[email protected]/pkg.go:29 +0xd3
      github.com/AlexAkulov/clickhouse-backup/pkg/config.LoadConfig()
          /src/pkg/config/config.go:280 +0xb44
      github.com/AlexAkulov/clickhouse-backup/pkg/backup.(*Backuper).Watch()
          /src/pkg/backup/watch.go:95 +0x68e
      github.com/AlexAkulov/clickhouse-backup/pkg/server.(*APIServer).RunWatch()
          /src/pkg/server/server.go:140 +0x48e
      github.com/AlexAkulov/clickhouse-backup/pkg/server.Run.func2()
          /src/pkg/server/server.go:109 +0x5b
    
    Previous read at 0x00000532fb30 by goroutine 93:
      github.com/apex/log.(*Logger).log()
          /root/go/pkg/mod/github.com/apex/[email protected]/logger.go:149 +0x8c
      github.com/apex/log.(*Entry).Info()
          /root/go/pkg/mod/github.com/apex/[email protected]/entry.go:96 +0x94
      github.com/apex/log.(*Entry).Infof()
          /root/go/pkg/mod/github.com/apex/[email protected]/entry.go:122 +0xec
      github.com/apex/log.(*Logger).Infof()
          /root/go/pkg/mod/github.com/apex/[email protected]/logger.go:121 +0xe4
      github.com/apex/log.Infof()
          /root/go/pkg/mod/github.com/apex/[email protected]/pkg.go:86 +0xc5
      github.com/AlexAkulov/clickhouse-backup/pkg/server.(*APIServer).UpdateBackupMetrics()
          /src/pkg/server/server.go:1148 +0x1c4
      github.com/AlexAkulov/clickhouse-backup/pkg/server.Run.func1()
          /src/pkg/server/server.go:103 +0xa4
    
  • CVE-2020-14040: Update golang.org/x/text version to v0.3.7

    CVE-2020-14040: Update golang.org/x/text version to v0.3.7

    The x/text package before 0.3.3 for Go has a vulnerability in encoding/unicode that could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory.

  • add WithTraceAt() method to adjust Trace() log level

    add WithTraceAt() method to adjust Trace() log level

    Hey @tj! I'm loving Apex's log module so far, and figured I'd take a crack at adding a method to allow .Trace() and .Stop() to log non-errors at a configurable level. I'm happy to rename that method as well — let me know what feels right to you :)


    The Trace() and Stop() methods for an Entry default to Info-level logging, and previously didn't offer a way to log non-errors at any other level. Add a WithTraceAt() method to allow that level to be configured.

    fixes #93

  • Add supplier pattern to avoid message creation overhead.

    Add supplier pattern to avoid message creation overhead.

    The supplier will only be invoked if the log line's level is met. Otherwise we avoid string creation. This is to optimize applications that may want to minimize extra string creation overhead.

  • Reducing allocations

    Reducing allocations

    First of all, thanks for creating this package.. i really love the simplicity of this code base. I could read the whole codebase and make sense out of it in 15 mins.

    However one this that concerns me is the no of allocations as benchmarked here https://github.com/uber-go/zap#performance

    Would like to use this place to huddle on improvements that can be done to reduce the no of allocations without sacrificing the simplicity of this codebase.

Structured logging package for Go.
Structured logging package for Go.

Package log implements a simple structured logging API inspired by Logrus, designed with centralization in mind. Read more on Medium. Handlers apexlog

Dec 24, 2022
Package logging implements a logging infrastructure for Go
Package logging implements a logging infrastructure for Go

Golang logging library Package logging implements a logging infrastructure for Go. Its output format is customizable and supports different logging ba

Nov 10, 2021
Simple, configurable and scalable Structured Logging for Go.

log Log is a simple, highly configurable, Structured Logging library Why another logging library? There's allot of great stuff out there, but also tho

Sep 26, 2022
Structured, composable logging for Go
Structured, composable logging for Go

log15 Package log15 provides an opinionated, simple toolkit for best-practice logging in Go (golang) that is both human and machine readable. It is mo

Dec 18, 2022
Structured, pluggable logging for Go.
Structured, pluggable logging for Go.

Logrus Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger. Logrus is in maintenance-mode. We wi

Jan 9, 2023
Structured Logging Made Easy
Structured Logging Made Easy

Structured Logging Made Easy Features Dependency Free Simple and Clean Interface Consistent Writer IOWriter, io.Writer wrapper FileWriter, rotating &

Jan 3, 2023
Blazing fast, structured, leveled logging in Go.

⚡ zap Blazing fast, structured, leveled logging in Go. Installation go get -u go.uber.org/zap Note that zap only supports the two most recent minor ve

Jan 7, 2023
Hierarchical, leveled, and structured logging library for Go

spacelog Please see http://godoc.org/github.com/spacemonkeygo/spacelog for info License Copyright (C) 2014 Space Monkey, Inc. Licensed under the Apach

Apr 27, 2021
Logrus is a structured, pluggable logging for Go.
Logrus is a structured, pluggable logging for Go.

Logrus is a structured logger for Go (golang), completely API compatible with the standard library logger.

May 25, 2021
Minimal structured logging library for Go
Minimal structured logging library for Go

slog slog is a minimal structured logging library for Go. Install go get cdr.dev/slog Features Minimal API First class context.Context support First c

Dec 29, 2022
Fully asynchronous, structured, pluggable logging for Go.

logr Logr is a fully asynchronous, contextual logger for Go. It is very much inspired by Logrus but addresses two issues: Logr is fully asynchronous,

Dec 28, 2022
structured logging helper

Logart Logart is a structured logging tool that aims to simplify logging to a database It is not yet in stable state, but is used in production and ac

Apr 24, 2021
Go-metalog - Standard API for structured logging

Metalog is a standard API for structured logging and adapters for its implementa

Jan 20, 2022
A simple logging module for go, with a rotating file feature and console logging.

A simple logging module for go, with a rotating file feature and console logging. Installation go get github.com/jbrodriguez/mlog Usage Sample usage W

Dec 14, 2022
FactorLog is a logging infrastructure for Go that provides numerous logging functions for whatever your style may be
FactorLog is a logging infrastructure for Go that provides numerous logging functions for whatever your style may be

FactorLog FactorLog is a fast logging infrastructure for Go that provides numerous logging functions for whatever your style may be. It could easily b

Aug 3, 2022
Errr - Errr (The Rich Structured Error Package missing from Go)

The errr package was created to fill the gap between error handling and error reporting.

Feb 7, 2022
A Go (golang) package providing high-performance asynchronous logging, message filtering by severity and category, and multiple message targets.

ozzo-log Other languages 简体中文 Русский Description ozzo-log is a Go package providing enhanced logging support for Go programs. It has the following fe

Dec 17, 2022
Package for easy logging to logstash http input from microservices

Micro Logger package for easy logging to logstash http input from microservices

Dec 28, 2021
This package enables json output, level logging and so on to standard go logger.

logplug This package enables json output, level logging and so on to standard logger. Usage log.SetOutput(logplug.NewJSONPlug(os.Stderr, logplug.LogF

Dec 27, 2021