{"id":42947274,"url":"https://github.com/gol4ng/logger","last_synced_at":"2026-01-30T20:37:28.597Z","repository":{"id":34199669,"uuid":"165130687","full_name":"gol4ng/logger","owner":"gol4ng","description":"another GO logger. The main line is to provide a friendly and fast API to send your log wherever you want.","archived":false,"fork":false,"pushed_at":"2023-02-27T17:31:49.000Z","size":322,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T08:37:14.819Z","etag":null,"topics":["formatters","gelf","gelf-format","go","go-logger","golang","golang-logger","handlers","json","log","logger","logger-interface","logger-middleware","logging","loging","socket","stream","structured-logging","writer"],"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/gol4ng.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":"2019-01-10T21:03:38.000Z","updated_at":"2023-09-08T17:49:08.000Z","dependencies_parsed_at":"2024-06-18T21:10:40.893Z","dependency_job_id":"c7c9fdff-9ec1-4292-885b-d4f9c31db792","html_url":"https://github.com/gol4ng/logger","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/gol4ng/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gol4ng%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gol4ng%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gol4ng%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gol4ng%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gol4ng","download_url":"https://codeload.github.com/gol4ng/logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gol4ng%2Flogger/sbom","scorecard":{"id":434345,"data":{"date":"2025-08-11","repo":{"name":"github.com/gol4ng/logger","commit":"28a15c8a1eb6842664fe411cbb55bc82bee64639"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":4,"reason":"Found 14/30 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T04:13:25.869Z","repository_id":34199669,"created_at":"2025-08-19T04:13:25.869Z","updated_at":"2025-08-19T04:13:25.869Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["formatters","gelf","gelf-format","go","go-logger","golang","golang-logger","handlers","json","log","logger","logger-interface","logger-middleware","logging","loging","socket","stream","structured-logging","writer"],"created_at":"2026-01-30T20:37:28.464Z","updated_at":"2026-01-30T20:37:28.569Z","avatar_url":"https://github.com/gol4ng.png","language":"Go","readme":"# Logger\n\n\u003cimg src=\"logo.png\" alt=\"gol4ng/logger: Golang logger\" title=\"A new golang logger\" align=\"right\" width=\"200px\"\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/gol4ng/logger)](https://goreportcard.com/report/github.com/gol4ng/logger)\n[![Maintainability](https://api.codeclimate.com/v1/badges/a234f5fd2bcae54ed85e/maintainability)](https://codeclimate.com/github/gol4ng/logger/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/a234f5fd2bcae54ed85e/test_coverage)](https://codeclimate.com/github/gol4ng/logger/test_coverage)\n[![Build Status](https://travis-ci.org/gol4ng/logger.svg?branch=master)](https://travis-ci.org/gol4ng/logger)\n[![GoDoc](https://godoc.org/github.com/gol4ng/logger?status.svg)](https://godoc.org/github.com/gol4ng/logger)\n\nGol4ng/Logger is another GO logger. The main line is to provide a friendly and fast API to send your log whenever you want. \n\n## Why another one?\n\nWhen i start GO i searched a logger that can be **simple to use**, **efficient**, **multi output**, **multi formats** and quite easy to **extend**. \nThat's why i created this logger with built-in [handlers](#Handlers)(process a log), [formatters](#formatters)(format log in another representation), [middlewares](#middlewares)(log modification before handler)\n\n## Installation\n\n`go get -u github.com/gol4ng/logger`\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"runtime\"\n\t\n\t\"github.com/gol4ng/logger\"\n\t\"github.com/gol4ng/logger/formatter\"\n\t\"github.com/gol4ng/logger/handler\"\n)\n\nfunc main(){\n\t// logger will print on STDOUT with default line format\n\tl := logger.NewLogger(handler.Stream(os.Stdout, formatter.NewDefaultFormatter(formatter.WithContext(true))))\n\t\n\tl.Debug(\"Go debug information\", logger.String(\"go_os\", runtime.GOOS), logger.String(\"go_arch\", runtime.GOARCH))\n\t// \u003cdebug\u003e MyExample message {\"go_arch\":\"amd64\",\"go_os\":\"darwin\"}\n\t\n\tl.Info(\"Another\")\n    //\u003cinfo\u003e Another\n}\n```\n\n## Logger interface\n\nThis library expose some quite simple interfaces.\n\nSimplest one\n```go\ntype LogInterface interface {\n\tLog(message string, level Level, field ...Field)\n}\n```\n\nThe friendly one\n```go\ntype LoggerInterface interface {\n\tLogInterface\n\tDebug(message string, field ...Field)\n\tInfo(message string, field ...Field)\n\tNotice(message string, field ...Field)\n\tWarning(message string, field ...Field)\n\tError(message string, field ...Field)\n\tCritical(message string, field ...Field)\n\tAlert(message string, field ...Field)\n\tEmergency(message string, field ...Field)\n}\n```\n\n## Handlers\n\nHandlers are log entry processor. It received a log entry and process it in order to send log to it's destination \n\nAvailable handlers:\n- **stream** _it will write formatted log in io.Writer_\n- **socket** _it will write formatted log in net.Conn_\n- **chan** _send all entry in provided go channel_\n- **gelf** _format to gelf and send to gelf server (TCP or UDP gzipped chunk)_\n- **group** _it will send log to all provided child handlers_\n- **rotate** _it will write formatted log in file and rotate file (mode: interval/archive)_\n- **syslog** _send formatted log in syslog server_\n\n## Formatters\n\nThe formatter convert log entry to a string representation (text, json, gelf...)\nThey are often inject in handler to do the conversion process\n\nAvailable formatters:\n- **default** `\u003cinfo\u003e My log message {\"my_key\":\"my_value\"}`\n- **line** _it's just a `fmt.Sprintf` facade_ format:`%s %s %s` will produce `My log message info \u003cmy_key:my_value\u003e`\n- **gelf** _format log entry to gelf_ `{\"version\":\"1.1\",\"host\":\"my_fake_hostname\",\"level\":6,\"timestamp\":513216000.000,\"short_message\":\"My log message\",\"full_message\":\"\u003cinfo\u003e My log message [ \u003cmy key:my_value\u003e ]\",\"_my_key\":\"my_value\"}`\n- **json** _format log entry to json_ `{\"Message\":\"My log message\",\"Level\":6,\"Context\":{\"my_key\":\"my_value\"}}`\n\n## Middlewares\n\nThe middleware are handler decorator/wrapper. It will allow you to do some process around child handler \n\nAvailable middleware:\n- **caller** _it will add caller file/line to context_ `\u003cfile:/my/example/path/file\u003e \u003cline:31\u003e`\n- **context** _it permit to have a default context value_ useful when you want to set global context value\n- **error** _it will print provided handler error_ (can be configure to silent it)\n- **filter** _it will permit to filter log entry_ level filter are available or you can use your own callback filter\n- **placeholder** _it will replace log message placeholder with contextual value_\n- **recover** _it will convert handler panic to error_\n- **timestamp** _it will add timestamp to log context_\n\n## Writers\n\nWriters are use by handler to write/send log to appropriate destination\n\nAvailable writer:\n- **compress** _it will compress log to gzip/zlib_\n- **gelf_chunked** _it will chunked log entry into gelf chunk_\n- **rotate** _it will write in io.Writer and rotate writer on demand_\n- **time_rotate** _it's a rotate writer that rotate with `time.Ticker`_\n\n### Todo\n- benchmark\n- Implement all the handler\n    - SSE http endpoint\n    - websocket server \n    - socket server\n    - https://craig.is/writing/chrome-logger\n    - fingercross\n    - grpc / protobuf\n    - curl\n    - Mail\n    - Slack\n    - hipchat\n    - amqp\n    - redis\n    - elasticsearch\n    - newrelic\n    - browser console\n    - couchdb\n    - cube\n    - ifttt\n    - InsightOps\n    - mandrill\n    - pushover\n    - raven\n    - rollbar\n    - sampling\n    - LogEntries\n    - ???\n    \n- Implement all the formatter\n    - html\n    - proto\n    - slack\n    - flowdoc\n    - fluentd\n    - logstash\n    - mongodb\n    - wildfire\n \n### Idea\n\n- log server with log routing\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgol4ng%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgol4ng%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgol4ng%2Flogger/lists"}