Skip to content

Simple audit trail implementation with interchangeable backends.

License

Notifications You must be signed in to change notification settings

botchris/go-auditrail

Repository files navigation

Go Auditrail

go test golangci-lint

Provides a simple interface for logging audit events in Go with support for multiple backends such as file, Elasticsearch, and more.

Installation

go get github.com/auditrail/go-auditrail

Usage

package main

import (
    "context"
    "fmt"
    "os"

    "github.com/botchris/go-auditrail"
)

func main() {
    // Create a new client
    client := auditrail.NewFileLogger(os.Stdout)

    // Log a message
    entry := auditrail.NewEntry("john", "order.deleted", "ordersService")

    if err := client.Log(context.TODO(), entry); err != nil {
        fmt.Println(err.Error())
    }

}

About

Simple audit trail implementation with interchangeable backends.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages