{"id":37200272,"url":"https://github.com/aatuh/logger","last_synced_at":"2026-01-14T23:02:43.512Z","repository":{"id":318113705,"uuid":"1069798679","full_name":"aatuh/logger","owner":"aatuh","description":"Production-ready, structured logger for Go with formats, colors, and async.","archived":false,"fork":false,"pushed_at":"2025-10-05T06:08:08.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-12T21:24:32.830Z","etag":null,"topics":["ansi","async","circuit-breaker","context","developer-experience","ecs","gcp","go","golang","json-logging","logfmt","logging","retry","sinks","spooling","structured-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/aatuh.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":"security/allowlist.go","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T16:40:13.000Z","updated_at":"2025-10-05T06:09:13.000Z","dependencies_parsed_at":"2025-10-05T08:21:19.904Z","dependency_job_id":"6dbff04d-cf0d-4e64-8a14-69079cbfc2e2","html_url":"https://github.com/aatuh/logger","commit_stats":null,"previous_names":["aatuh/logger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aatuh/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatuh%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatuh%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatuh%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatuh%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aatuh","download_url":"https://codeload.github.com/aatuh/logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aatuh%2Flogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","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":["ansi","async","circuit-breaker","context","developer-experience","ecs","gcp","go","golang","json-logging","logfmt","logging","retry","sinks","spooling","structured-logging"],"created_at":"2026-01-14T23:02:42.826Z","updated_at":"2026-01-14T23:02:43.468Z","avatar_url":"https://github.com/aatuh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logger\n\nA production-ready, context-aware, structured logger for Go.\nJSON/logfmt/ECS/GCP formats, ANSI colors, child fields, async flushing,\nand pluggable sinks. Sensible defaults for dev and prod, plus security\nhelpers (redaction, size limits, allowlist). See examples/ to copy-paste\nusage.\n\n## Features\n\n### Core API \u0026 Ergonomics\n\n- **Child loggers**: `With(fields)` for persistent context\n- **Multiple formats**: JSON, logfmt, ECS, GCP Cloud Logging, Console\n- **Message shaping**: `Msgf()`, `Err(err).Msg()`, `KV()` helpers\n- **Dynamic levels**: Runtime level changes with `SetLevel()`\n- **Smart defaults**: TTY detection, `NO_COLOR` support\n\n### Performance \u0026 Concurrency\n\n- **Batching**: Configurable batch sizes and timeouts\n- **Backpressure**: Block, drop oldest, or sample strategies\n- **Zero-alloc**: Buffer pooling with `sync.Pool`\n- **Atomic config**: Thread-safe configuration updates\n\n### Reliability \u0026 Delivery\n\n- **Pluggable sinks**: stdout, stderr, file, HTTP, with retry/backoff\n- **Circuit breakers**: Automatic failure detection and recovery\n- **Spool to disk**: Network outage resilience\n- **Crash-safe hooks**: Isolated error handling\n\n### Experimental Features\n\nThe following features are marked as experimental and may change in future versions:\n\n- **HTTPSink**: HTTP endpoint logging with retry and circuit breaker support\n- **RetrySink**: Exponential backoff with failure tracking\n- **CircuitBreakerSink**: Failure windows, half-open probing, and state management\n- **SpoolSink**: Disk persistence on failure and drain on recovery\n- **Metrics \u0026 Health**: Real-time observability with Prometheus export\n- **PrometheusExporter**: Metrics export functionality\n\nThese features are production-ready but may have API changes in future versions.\n\n### Security \u0026 Compliance\n\n- **PII redaction**: Email, SSN, credit card, phone number patterns\n- **Secret scrubbing**: Password, API key, token auto-masking\n- **Size limits**: Configurable message truncation\n- **Schema allowlist**: Field-level access control\n\n### Observability\n\n- **Prometheus metrics**: `logs_emitted_total`, `queue_depth`, etc.\n- **Health checks**: `logger.Health()` with diagnostics\n- **Self-diagnostics**: Comprehensive system status\n\n## Quick Start\n\nGet started by reading the usage examples in the [`examples/`](./examples)\npackage.\n\nRunning examples:\n\n```bash\n# Run all examples.\ngo test ./examples -count 1 -v\n\n# Run specific example.\ngo test ./examples -count 1 -v -run Test_BasicLogging\n```\n\n## Configuration\n\n### Environment Variables\n\n```bash\nexport LOG_LEVEL=INFO\nexport LOG_FORMAT=json\nexport LOG_COLOR=true\nexport LOG_ASYNC_BUF=1000\nexport NO_COLOR=1  # Disable colors\n```\n\n### Smart Configuration\n\nUse the smart builder for environment-aware defaults:\n\n```go\n// Automatically detects environment and applies appropriate defaults\nsmartLogger := logger.NewSmart(ctx, func(context.Context) *logger.ExtraData {\n    return \u0026logger.ExtraData{\n        TraceID: \"trace-123\",\n        SpanID:  \"span-456\",\n    }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatuh%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faatuh%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faatuh%2Flogger/lists"}