syslog

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 4 Imported by: 0

README

go-kratos-log-syslog

Go Version GoDoc codecov Go Report Card tests MIT license

Installation

go get github.com/go-packagist/go-kratos-log-syslog

Usage

package main

import (
	"github.com/go-kratos/kratos/v2/log"
	syslog "github.com/go-packagist/go-kratos-log-syslog"
)

func main() {
	s, err := syslog.New(&syslog.Config{
		Network: "udp",
		Tag:     "test",
		Addr:    "192.168.8.92:30732",
	})
	if err != nil {
		panic(err)
	}
	defer s.Close()

	s.Log(log.LevelDebug, "test", "test")
}

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Network string
	Addr    string
	Tag     string
}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Log

func (l *Logger) Log(level log.Level, keyvals ...interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL