Categorygithub.com/bsphere/le_go
modulepackage
0.0.0-20200109081728-fc06dab2caa8
Repository: https://github.com/bsphere/le_go.git
Documentation: pkg.go.dev

# README

le_go

Golang client library for logentries.com

It is compatible with http://golang.org/pkg/log/#Logger and also implements http://golang.org/pkg/io/#Writer

GoDoc

Build Status

Usage

Add a new manual TCP token log at logentries.com and copy the token.

Installation: go get github.com/bsphere/le_go

Note: The Logger is blocking, it can be easily run in a goroutine by calling go le.Println(...)

package main

import "github.com/bsphere/le_go"

func main() {
	le, err := le_go.Connect("XXXX-XXXX-XXXX-XXXX") // replace with token
	if err != nil {
		panic(err)
	}

	defer le.Close()

	le.Println("another test message")
}

# Functions

Connect creates a new Logger instance and opens a TCP connection to logentries.com, The token can be generated at logentries.com by adding a new log, choosing manual configuration and token based TCP connection.

# Structs

Logger represents a Logentries logger, it holds the open TCP connection, access token, prefix and flags.