Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.33 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.33 KB

LogFlake Client Go

This repository contains the sources for the client-side components of the LogFlake product suite for applications logs and performance collection for Golang applications.

🏠 [LogFlake Website](https://logflake.io) | 🔥 [CloudPhoenix Website](https://cloudphoenix.it)

Downloads

Package Name Version
logflake-client-go GitHub Tag

Usage

Retrieve your application-key from Application Settings in LogFlake UI.

import "github.com/CloudPhoenix/logflake-client-go/logflake"
i := logflake.New("application-key")

i.SendLog(logflake.Log{
    Content: "Hello World",
    Level:   logflake.LevelInfo,
})

log/slog handler

Use LogFlake as slog handler

i := logflake.New("application-key")

logger := slog.New(logflake.SlogOption{
    Level: slog.LevelDebug,
    Instance: i,
}.NewLogFlakeHandler())

slog.SetDefault(logger)