{"id":15137075,"url":"https://github.com/s4s7/soglog","last_synced_at":"2025-07-19T19:34:32.229Z","repository":{"id":238490205,"uuid":"796667010","full_name":"s4s7/soglog","owner":"s4s7","description":"slog initializer for minimalist (Golang, Opentelemetry, Google Cloud)","archived":false,"fork":false,"pushed_at":"2024-05-28T16:26:39.000Z","size":33,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-11T12:32:03.128Z","etag":null,"topics":["cloudlogging","cloudtrace","golang","google-cloud","opentelemetry","slog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s4s7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T11:56:41.000Z","updated_at":"2024-05-28T16:22:39.000Z","dependencies_parsed_at":"2024-05-16T02:10:32.960Z","dependency_job_id":"9f7d127f-dbd8-4044-a073-7c9ad9fdc054","html_url":"https://github.com/s4s7/soglog","commit_stats":null,"previous_names":["s4s7/soglog"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/s4s7/soglog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4s7%2Fsoglog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4s7%2Fsoglog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4s7%2Fsoglog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4s7%2Fsoglog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s4s7","download_url":"https://codeload.github.com/s4s7/soglog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4s7%2Fsoglog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265999094,"owners_count":23862219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudlogging","cloudtrace","golang","google-cloud","opentelemetry","slog"],"created_at":"2024-09-26T06:43:17.071Z","updated_at":"2025-07-19T19:34:32.208Z","avatar_url":"https://github.com/s4s7.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"350\" alt=\"image\" src=\"https://github.com/s4s7/soglog/assets/41041296/a1acbd3a-81e0-48ef-8c5a-99a23978c9a0\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003csamp\u003e\n\n# Minimalist Logger \u003cbr\u003e based on slog with Otel for GoogleCloud\n![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.21-%23007d9c)\n[![GoDoc](https://godoc.org/github.com/samber/slog-multi?status.svg)](https://pkg.go.dev/github.com/s4s7/soglog)\n\nsog stands for **S**tructured **O**tel **G**oogleCloud, inspired by [clog](https://github.com/nownabe/clog). \nSpecial thanks to nownabe.\n\n\u003c/samp\u003e\n\u003c/div\u003e\n\n\n## Key Features\n1. **When the log level is set to error, a stack trace will be displayed.**  \n   \n\n|                                                                                                                         |                                                                                                                                                                                  |\n|-------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| \u003cimg width=\"400\" alt=\"image\" src=\"https://github.com/s4s7/soglog/assets/41041296/de36ba4d-06ef-405a-a097-c6cff5c12b3d\"\u003e | The display of stack traces can be easily controlled at initialization. \u003cbr\u003eFor example, you can configure it to hide stack traces locally, while enabling them on Google Cloud. |\n\n2. **You can add additional information from the context (ctx) to labels.**\n\n|                                                                                                                         |                                                                                                                                                                     |\n|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| \u003cimg width=\"200\" alt=\"image\" src=\"https://github.com/s4s7/soglog/assets/41041296/d1fddd4f-29a3-4cc6-add1-e2eb7adcfe9c\"\u003e | Insert code that corresponds to the following type during initialization \u003cbr\u003e ``type LabelFieldInjector func(ctx context.Context) (key, value string, found bool)`` |\n\n3. **You can initialize slog with a one-liner at server startup, allowing you to use its default slog methods throughout your application**\n\n```golang\nslog.SetDefault(slog.New(soglog.NewCloudLoggingHandler(\"your-project-id\", \u0026soglog.Options{IsStackTraced: true, LabelFieldInjector: yourLabelFieldInjector})\n```\n\n## Note\nsoglog is strictly designed within the functionalities of the slog to support cloud logging. Therefore, soglog supports only 4 log levels: `Debug`, `Info`, `Warn`, and `Error`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4s7%2Fsoglog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs4s7%2Fsoglog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4s7%2Fsoglog/lists"}