{"id":15647592,"url":"https://github.com/drdaeman/logdna-logrus","last_synced_at":"2025-03-29T23:25:27.464Z","repository":{"id":57492302,"uuid":"113091122","full_name":"drdaeman/logdna-logrus","owner":"drdaeman","description":"LogDNA Logrus and Logrus Mate library","archived":false,"fork":false,"pushed_at":"2020-07-17T21:47:33.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T00:46:34.651Z","etag":null,"topics":["go","golang","golang-library","logdna","logging","logrus-hook"],"latest_commit_sha":null,"homepage":null,"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/drdaeman.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":"2017-12-04T20:25:04.000Z","updated_at":"2021-11-26T13:11:58.000Z","dependencies_parsed_at":"2022-09-02T00:20:41.597Z","dependency_job_id":null,"html_url":"https://github.com/drdaeman/logdna-logrus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Flogdna-logrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Flogdna-logrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Flogdna-logrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drdaeman%2Flogdna-logrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drdaeman","download_url":"https://codeload.github.com/drdaeman/logdna-logrus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258093,"owners_count":20748509,"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":["go","golang","golang-library","logdna","logging","logrus-hook"],"created_at":"2024-10-03T12:20:04.206Z","updated_at":"2025-03-29T23:25:27.446Z","avatar_url":"https://github.com/drdaeman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"LogDNA Logrus and Logrus Mate library\n=====================================\n\n[![Go Report Card][grc-badge]][grc]\n\nThis library allows logging to [LogDNA][logdna] from [Logrus][logrus],\noptionally configuring everything using [Logrus Mate][mate].\n\nThis library is not currently actively maintained.\n\nConfiguration\n-------------\n\nCheck out the `example/` subdirectory for a simple example.\n\nYou can create hook manually, `New` method or using Logrus Mate.\nFor HOCON configuration provider (the default), add a hook like this:\n\n    your-logger {\n        ...\n        hooks {\n            logdna {\n                api-key = \"your-ingestion-key-here\"\n                app = \"myapp\"\n                json = true\n            }\n            ...\n        }\n        ...\n    }\n\nThe supported options are:\n\n  - `api-key`: ingestion key, mandatory\n  - `hostname`: hostname override, if not specified will use `os.Hostname()`\n  - `mac`: host MAC address, not sent if empty, no autodetection for now\n  - `ip`: host IP address, ditto\n  - `app`: app identifier, for LogDNA to filter\n  - `env`: environment identifier, for LogDNA to filter\n  - `size`: buffer size, in entries, defaults to 4096\n  - `flush`: flush interval, defaults to 10 seconds\n  - `qsize`: buffered channel size\n  - `drop`: whenever hook's allowed to drop messages (if buffer's full etc).\n    Logging will block if this is false and there are size+qsize entries\n    waiting to be sent.\n  - `json`: how to send structured log fields. Will format line as JSON if set\n    to true (using `\"message\"` key for log message), or pass fields as `meta`\n    if not.\n  - `text-format`: whenever to also include structured logging data in the\n    message. Default to false, enabling will append key-value pairs to\n    the message texts, so they'll be immediately visible.\n  - `url` allows to override the ignestion endpoint URL (e.g. for testing)\n\nWith `New` method and `Config` struct you have a little more flexibility,\nas you can specify any `MessageFormatter` rather than just `text-format`.\n\nLimitations\n-----------\n\nAs the logging is asynchronous, error handling is limited.\nIf `drop` is set to true, you can lose messages on outages.\nIf `drop` is false, program may panic at shutdown, or buffer size\nmay grow past the `size` limit.\n\nAlso, to give the hooks chance flush before the program exits,\ndon't forget to add `defer logrus.Exit(0)` to your `main`.\n\nSuggestions (and pull requests) are welcomed.\n\n[logdna]: https://logdna.com\n[logrus]: https://github.com/sirupsen/logrus\n[mate]: https://github.com/gogap/logrus_mate\n[grc-badge]: https://goreportcard.com/badge/github.com/drdaeman/logdna-logrus\n[grc]: https://goreportcard.com/report/github.com/drdaeman/logdna-logrus\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdaeman%2Flogdna-logrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrdaeman%2Flogdna-logrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrdaeman%2Flogdna-logrus/lists"}