{"id":18728814,"url":"https://github.com/yukitsune/lokirus","last_synced_at":"2025-10-11T20:46:50.685Z","repository":{"id":39672994,"uuid":"488567193","full_name":"YuKitsune/lokirus","owner":"YuKitsune","description":"A Loki hook for Logrus","archived":false,"fork":false,"pushed_at":"2023-01-21T10:35:24.000Z","size":862,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T20:46:49.354Z","etag":null,"topics":["logrus","logrus-hook","loki"],"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/YuKitsune.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-05-04T11:48:38.000Z","updated_at":"2025-05-17T21:47:11.000Z","dependencies_parsed_at":"2023-02-12T09:00:40.151Z","dependency_job_id":null,"html_url":"https://github.com/YuKitsune/lokirus","commit_stats":null,"previous_names":["yukitsune/logrus-loki"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/YuKitsune/lokirus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuKitsune%2Flokirus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuKitsune%2Flokirus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuKitsune%2Flokirus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuKitsune%2Flokirus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YuKitsune","download_url":"https://codeload.github.com/YuKitsune/lokirus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YuKitsune%2Flokirus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008632,"owners_count":26084480,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["logrus","logrus-hook","loki"],"created_at":"2024-11-07T14:24:26.728Z","updated_at":"2025-10-11T20:46:50.667Z","avatar_url":"https://github.com/YuKitsune.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Logrus + Loki = ❤️\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e\n  A \u003ca href=\"https://grafana.com/oss/loki/\"\u003eLoki\u003c/a\u003e hook for \u003ca href=\"https://github.com/Sirupsen/logrus\"\u003eLogrus\u003c/a\u003e\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/yukitsune/lokirus/go.yml?branch=main)](https://github.com/YuKitsune/lokirus/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/yukitsune/lokirus)](https://goreportcard.com/report/github.com/yukitsune/lokirus)\n[![License](https://img.shields.io/github/license/YuKitsune/lokirus)](https://github.com/YuKitsune/lokirus/blob/main/LICENSE)\n[![Latest Release](https://img.shields.io/github/v/release/YuKitsune/lokirus?include_prereleases)](https://github.com/YuKitsune/lokirus/releases)\n[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/yukitsune/lokirus)](https://pkg.go.dev/mod/github.com/yukitsune/lokirus)\n\n  \u003cimg src=\"demo.gif\" /\u003e\n\u003c/h3\u003e\n\n# Installation\n\n```sh\ngo get github.com/yukitsune/lokirus\n```\n\n# Usage\n\n```go\npackage main\n\nfunc main() {\n\n\t// Configure the Loki hook\n\topts := lokirus.NewLokiHookOptions().\n\t\t// Grafana doesn't have a \"panic\" level, but it does have a \"critical\" level\n \t // https://grafana.com/docs/grafana/latest/explore/logs-integration/\n\t\tWithLevelMap(lokirus.LevelMap{logrus.PanicLevel: \"critical\"}).\n   \t\tWithFormatter(\u0026logrus.JSONFormatter{}).\n\t\tWithStaticLabels(lokirus.Labels{\n\t\t\t\"app\":         \"example\",\n\t\t\t\"environment\": \"development\",\n\t\t}).\n\t\tWithBasicAuth(\"admin\", \"secretpassword\") // Optional\n\n\thook := lokirus.NewLokiHookWithOpts(\n\t\t\"http://localhost:3100\",\n\t\topts,\n\t\tlogrus.InfoLevel,\n\t\tlogrus.WarnLevel,\n\t\tlogrus.ErrorLevel,\n\t\tlogrus.FatalLevel)\n\n\t// Configure the logger\n\tlogger := logrus.New()\n\tlogger.AddHook(hook)\n\n\t// Log all the things!\n  logger.WithField(\"fizz\", \"buzz\").Warnln(\"warning\")\n}\n```\n\n# Contributing\n\nContributions are what make the open source community such an amazing place to be, learn, inspire, and create.\nAny contributions you make are **greatly appreciated**!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukitsune%2Flokirus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyukitsune%2Flokirus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyukitsune%2Flokirus/lists"}