{"id":16768145,"url":"https://github.com/muratmirgun/logger-go","last_synced_at":"2025-06-23T05:43:07.188Z","repository":{"id":138312178,"uuid":"328405140","full_name":"muratmirgun/logger-go","owner":"muratmirgun","description":"This extremely simple log library is intended for use with micro service applications,","archived":false,"fork":false,"pushed_at":"2021-01-10T14:45:38.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T23:24:20.036Z","etag":null,"topics":["golang","log","logger","logging"],"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/muratmirgun.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":"2021-01-10T14:41:49.000Z","updated_at":"2024-06-19T05:19:40.101Z","dependencies_parsed_at":"2023-07-05T00:01:50.868Z","dependency_job_id":null,"html_url":"https://github.com/muratmirgun/logger-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratmirgun%2Flogger-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratmirgun%2Flogger-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratmirgun%2Flogger-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratmirgun%2Flogger-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratmirgun","download_url":"https://codeload.github.com/muratmirgun/logger-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243872925,"owners_count":20361579,"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":["golang","log","logger","logging"],"created_at":"2024-10-13T06:10:52.397Z","updated_at":"2025-03-16T13:22:54.544Z","avatar_url":"https://github.com/muratmirgun.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# log\n\nThis extremely simple log library is intended for use with micro service\napplications, which have only two logging targets: the console while\ndeveloping the application, and a log aggregation service in production.\n\nThis library was inspired by:\n\n* [Logging Packages in Golang](https://www.client9.com/logging-packages-in-golang/)\n* [logrus](https://github.com/sirupsen/logrus)\n* [Benchmarking Logging Libraries for Go](https://github.com/imkira/go-loggers-bench)\n\n## Features\n\n* The `fmt` library is not used to minimize memory allocations.\n* Logs to `stdout` by default.\n* Can be configured to send messages to a UDP log aggregator.\n\n## Usage\n\nBy default, `log` will emit messages on `os.Stderr` which is supposed to be\nan unbuffered stream. The destination can be changed with: \n\n```go\nlog.SetOutput(os.Stdout)\n``` \n\nTo prevent console logging from being visible at all, change the destination\nto `/dev/null`:\n\n```go\ndevnull, err := os.OpenFile(os.DevNull, O_WRONLY, 0666)\nif err != null {\n\tpanic(err)\n}\ndefer devnull.Close()\nlog.SetOutput(devnull)\n```\n\nTo send output to a UDP log aggregator, just set the address and port of the\nservice as follows:\n\n```go\nlog.SetServer(\"10.10.10.10:8080\")\n```\n\nNow every log message is formatted in JSON and will be sent to the aggregator:\n\n```go\nlog.Info(\"The quick brown fox\")\n// Output: {\"time\":1554370662469959000,\"name\":\"main\",\"level\":\"INFO\",\"message\":\"The quick brown fox\"} \n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratmirgun%2Flogger-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratmirgun%2Flogger-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratmirgun%2Flogger-go/lists"}