{"id":13640635,"url":"https://github.com/zio/zio-logging","last_synced_at":"2026-01-16T07:19:24.135Z","repository":{"id":37768246,"uuid":"207323800","full_name":"zio/zio-logging","owner":"zio","description":"Powerful logging for ZIO 2.0 applications, with compatibility with many logging backends out-of-the-box.","archived":false,"fork":false,"pushed_at":"2026-01-13T09:18:28.000Z","size":2735,"stargazers_count":186,"open_issues_count":14,"forks_count":81,"subscribers_count":10,"default_branch":"master","last_synced_at":"2026-01-13T11:44:22.583Z","etag":null,"topics":["fp","functional-programming","logging","scala","slf4j","tracing","zio"],"latest_commit_sha":null,"homepage":"https://zio.dev/zio-logging/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-09T14:04:57.000Z","updated_at":"2026-01-13T09:18:33.000Z","dependencies_parsed_at":"2024-01-22T22:18:19.005Z","dependency_job_id":"c9847149-8048-4d66-902d-d47fbca7cf7d","html_url":"https://github.com/zio/zio-logging","commit_stats":{"total_commits":521,"total_committers":53,"mean_commits":9.830188679245284,"dds":0.4952015355086372,"last_synced_commit":"9c14eaadf2264f194220043142c7e1af8ba08920"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"purl":"pkg:github/zio/zio-logging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zio","download_url":"https://codeload.github.com/zio/zio-logging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-logging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478047,"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":["fp","functional-programming","logging","scala","slf4j","tracing","zio"],"created_at":"2024-08-02T01:01:12.957Z","updated_at":"2026-01-16T07:19:24.120Z","avatar_url":"https://github.com/zio.png","language":"Scala","funding_links":[],"categories":["Official ZIO Libraries"],"sub_categories":[],"readme":"[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)\n[//]: # (So please do not edit it manually. Instead, change \"docs/index.md\" file or sbt setting keys)\n[//]: # (e.g. \"readmeDocumentation\" and \"readmeSupport\".)\n\n# zio-logging\n\n[ZIO Logging](https://github.com/zio/zio-logging) is simple logging for ZIO apps, with correlation, context, and pluggable backends out of the box with integrations for common logging backends.\n\n[![Production Ready](https://img.shields.io/badge/Project%20Stage-Production%20Ready-brightgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-logging/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-logging_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-logging_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-logging_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-logging_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-logging-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-logging-docs_2.13) [![zio-logging](https://img.shields.io/github/stars/zio/zio-logging?style=social)](https://github.com/zio/zio-logging)\n\n## Introduction\n\nWhen we are writing our applications using ZIO effects, to log easy way we need a ZIO native solution for logging.\n\nKey features of ZIO Logging:\n\n- **ZIO Native** — Other than it is a type-safe and purely functional solution, it leverages ZIO's features.\n- **Multi-Platform** - It supports JS, JVM and Native platforms for the core zio-logging module, all other modules are only available for JVM.\n- **Composable** — Loggers are composable together via contraMap.\n- **Pluggable Backends** — Support multiple backends like ZIO Console, SLF4j, JPL.\n- **Logger Context** — It has a first citizen _Logger Context_ implemented on top of `FiberRef`. The Logger Context maintains information like logger name, filters, correlation id, and so forth across different fibers. It supports _Mapped Diagnostic Context (MDC)_ which manages contextual information across fibers in a concurrent environment.\n- Richly integrated into ZIO 2's built-in logging facilities\n- ZIO Console, SLF4j, and other backends\n\n## Installation\n\nIn order to use this library, we need to add the following line in our `build.sbt` file:\n\n```scala\n// ZIO Logging backends\nlibraryDependencies += \"dev.zio\" %% \"zio-logging\" % \"2.5.3\"\n```\n\nThe main module contains the following features: \n* [console loggers](docs/console-logger.md)\n* [file loggers](docs/file-logger.md)\n* [log metrics](docs/metrics.md)\n\n\nOther modules:\n\n* SLF4J backend - if you like to use [`SLF4J`](https://www.slf4j.org/) logging backends (e.g. java.util.logging, logback, log4j), add the one of following lines to your `build.sbt` file:\n\n    ```scala\n    // SLF4j v1 integration\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-slf4j\" % \"2.5.3\"\n    \n    // SLF4j v2 integration\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-slf4j2\" % \"2.5.3\"\n    ```\n   When to use this module: you are already using SLF4J logger in some other project, and you like to have same log outputs. \n   See SLF4J [v2](docs/slf4j2.md) or [v1](docs/slf4j1.md) section for more details.\n\n\n* SLF4J bridge - with this logging bridge, it is possible to use `zio-logging` for SLF4J loggers (usually third-party non-ZIO libraries), add the one of following lines to your `build.sbt` file: \n\n    ```scala\n    // Using ZIO Logging for SLF4j v1 loggers, usually third-party non-ZIO libraries\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-slf4j-bridge\" % \"2.5.3\"\n    \n    // Using ZIO Logging for SLF4j v2 loggers, usually third-party non-ZIO libraries\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-slf4j2-bridge\" % \"2.5.3\"\n    ```\n\n    When to use this module: you want to use some zio-logger implementation, but also you are using some java library which using SLF4J interface for logging.\n    See SLF4J bridge [v2](docs/slf4j2-bridge.md) or [v1](docs/slf4j1-bridge.md) section for more details.\n\n\n* Java Platform/System Logger backend - if you like to use  [`Java Platform/System Logger`](https://openjdk.org/jeps/264) logging backend, add the following line to your `build.sbt` file:\n\n    ```scala\n    // JPL integration\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-jpl\" % \"2.5.3\"\n    ```\n\n    When to use this module: you are already using Java Platform/System Logger in some other project, and you like to have same log outputs.\n    See [Java Platform/System Logger](docs/jpl.md) section for more details.\n\n\n* java.util.logging bridge - with this logging bridge, it is possible to use `zio-logging` for JUL loggers (usually third-party non-ZIO libraries), add the one of following lines to your `build.sbt` file:\n\n    ```scala\n    // JUL bridge\n    libraryDependencies += \"dev.zio\" %% \"zio-logging-jul-bridge\" % \"2.5.3\"\n    ```\n\n    When to use this module: you are already using JUL logger in some other project, and you like to have same log outputs.\n    See [java.util.logging bridge](docs/jul-bridge.md) section for more details.\n\n\n## Example\n\nLet's try an example of ZIO Logging which demonstrates a simple application of ZIO logging.\n\nThe recommended place for setting the logger is application boostrap. In this case, custom logger will be set for whole application runtime (also application failures will be logged with specified logger).\n\n[//]: # (TODO: make snippet type-checked using mdoc)\n\n```scala\npackage zio.logging.example\n\nimport zio.logging.consoleLogger\nimport zio.{ ExitCode, Runtime, Scope, ZIO, ZIOAppArgs, ZIOAppDefault, ZLayer }\n\nobject SimpleApp extends ZIOAppDefault {\n\n  override val bootstrap: ZLayer[ZIOAppArgs, Any, Any] =\n    Runtime.removeDefaultLoggers \u003e\u003e\u003e consoleLogger()\n\n  override def run: ZIO[Scope, Any, ExitCode] =\n    for {\n      _ \u003c- ZIO.logInfo(\"Start\")\n      _ \u003c- ZIO.fail(\"FAILURE\")\n      _ \u003c- ZIO.logInfo(\"Done\")\n    } yield ExitCode.success\n\n}\n```\n\nExpected console output:\n\n```\ntimestamp=2023-03-15T08:36:24.421098+01:00 level=INFO thread=zio-fiber-4 message=\"Start\"\ntimestamp=2023-03-15T08:36:24.440181+01:00 level=ERROR thread=zio-fiber-0 message=\"\" cause=Exception in thread \"zio-fiber-4\" java.lang.String: FAILURE\n\tat zio.logging.example.SimpleApp.run(SimpleApp.scala:29)\n```\n\nYou can find the source code of examples [here](https://github.com/zio/zio-logging/tree/master/examples)\n\n## Documentation\n\nLearn more on the [zio-logging homepage](https://zio.dev/zio-logging)!\n\n## Contributing\n\nFor the general guidelines, see ZIO [contributor's guide](https://zio.dev/contributor-guidelines).\n\n## Code of Conduct\n\nSee the [Code of Conduct](https://zio.dev/code-of-conduct)\n\n## Support\n\nCome chat with us on [![Badge-Discord]][Link-Discord].\n\n[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord \"chat on discord\"\n[Link-Discord]: https://discord.gg/2ccFBr4 \"Discord\"\n\n## License\n\n[License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzio%2Fzio-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-logging/lists"}