Skip to content
/ slslog Public

CW Logs Insight で trace で一連の処理を追うことのできる Logger です。

License

Notifications You must be signed in to change notification settings

eure/slslog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1b0628b · Feb 21, 2025

History

22 Commits
Feb 21, 2025
Aug 3, 2022
Nov 19, 2020
Nov 11, 2020
Aug 3, 2022
Feb 21, 2025
Aug 25, 2024
Aug 26, 2024
Aug 26, 2024
Aug 26, 2024
Aug 3, 2022

Repository files navigation

slslog

Overview

AWS Lambda の標準出力に吐かれたログを Cloudwatch Logs Insight で trace 付きで一連の処理を追うことのできるための Logger です。

This is inspired by https://github.com/DeNA/aelog.

Usage

const label = "$LogLabelName"

func main() {
    slslog.SetLogLabel(label)
    span := slslog.StartSpan(context.Background(), label)
    defer span.End()

    ctx := span.Context()
    Infof(ctx, "this is slslog output")

    // Output:
    // {"severity":"INFO","message":"this is slslog output","trace":"service/$LogLabelName/trace/...","span":"service/$LogLabelName/span/..."}
}

See Also

About

CW Logs Insight で trace で一連の処理を追うことのできる Logger です。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages