Categorygithub.com/k0kubun/fluent-logger-go
modulepackage
0.0.0-20201119054120-59ff43471d04
Repository: https://github.com/k0kubun/fluent-logger-go.git
Documentation: pkg.go.dev

# README

fluent-logger-go

Goroutine based asynchronous event logger for Fluentd

Project status

Not maintained. Please use fluent/fluent-logger-golang instead.

Features

  • Channel based non-blocking logging interface
  • Queued events are periodically sent to fluentd altogether

Installation

$ go get github.com/k0kubun/fluent-logger-go

Usage

package main

import "github.com/gin-gonic/gin"
import "github.com/k0kubun/fluent-logger-go"

var logger *fluent.Logger

func logId(c *gin.Context) {
	id := c.Params.ByName("id")
	logger.Post("idlog", map[string]string{"id": id})
	c.String(200, "Logged id")
}

func main() {
	logger = fluent.NewLogger(fluent.Config{})
	r := gin.Default()
	r.GET("/:id", logId)
	r.Run(":3000")
}

Documentation

API documentation can be found here: https://godoc.org/github.com/k0kubun/fluent-logger-go

Related projects

You would like to use another one for some use case.

# Packages

No description provided by the author

# Functions

NewLogger() launches a goroutine to log and returns logger.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Config is just for fluent.NewLogger() argument.
Logger owns asynchronous logging to fluentd.