{"id":37581019,"url":"https://github.com/delixfe/zapappender","last_synced_at":"2026-01-16T09:39:25.640Z","repository":{"id":57695526,"uuid":"450432670","full_name":"delixfe/zapappender","owner":"delixfe","description":"Composable appender for uber-go/zap","archived":false,"fork":false,"pushed_at":"2022-11-24T10:49:09.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T11:59:25.200Z","etag":null,"topics":["golang","logger","logging","zap"],"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/delixfe.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}},"created_at":"2022-01-21T09:37:52.000Z","updated_at":"2022-11-24T10:28:35.000Z","dependencies_parsed_at":"2023-01-22T02:04:49.795Z","dependency_job_id":null,"html_url":"https://github.com/delixfe/zapappender","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/delixfe/zapappender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delixfe%2Fzapappender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delixfe%2Fzapappender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delixfe%2Fzapappender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delixfe%2Fzapappender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delixfe","download_url":"https://codeload.github.com/delixfe/zapappender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delixfe%2Fzapappender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: 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":["golang","logger","logging","zap"],"created_at":"2026-01-16T09:39:24.966Z","updated_at":"2026-01-16T09:39:25.633Z","avatar_url":"https://github.com/delixfe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zapappender [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov]\n\nComposable appender for uber-go/zap enabling:\n\n* Async logging\n* Fallback\n* Message Enveloping (like syslog formatting)\n\nThis project was created to allow logging to syslog over TCP.\n\n## Quick start\n\nFirstly, compose the appender chain:\n\n```go\nprimaryOut := zapappender.NewWriter(zapcore.Lock(someTcpWriter))\nconsoleWriter := zapappender.NewWriter(zapcore.Lock(os.Stdout))\nsecondaryOut := zapappender.NewEnvelopingPreSuffix(consoleWriter, \"FALLBACK: \", \"\")\nfallback := zapappender.NewFallback(primaryOut, secondaryOut)\nasync, _ := zapappender.NewAsync(fallback,\n    zapappender.AsyncOnQueueNearlyFullForwardTo(secondaryOut),\n    zapappender.AsyncMaxQueueLength(10),\n    zapappender.AsyncQueueMinFreePercent(0.2),\n    zapappender.AsyncQueueMonitorPeriod(time.Millisecond),\n)\nappenderChain := async\n```\n\nSecondly, use that chain to create a `zapcore.Core` and finally to construct a `zap.Logger`.\n\n```go\nencoder := zapcore.NewConsoleEncoder(encoderConfig)\ncore := zapappender.NewAppenderCore(encoder, appenderChain, zapcore.DebugLevel)\nlogger := zap.New(core)\n\nlogger.Info(\"this logs async\")\n```\n\nSee [example_test.go](example_test.go) for more details.\n\n[ci-img]: https://github.com/delixfe/zapappender/actions/workflows/go.yml/badge.svg\n[ci]: https://github.com/delixfe/zapappender/actions/workflows/go.yml\n[cov-img]: https://codecov.io/gh/delixfe/zapappender/branch/main/graph/badge.svg?token=S4C8RNUGNE\n[cov]: https://codecov.io/gh/delixfe/zapappender\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelixfe%2Fzapappender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelixfe%2Fzapappender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelixfe%2Fzapappender/lists"}