{"id":37231223,"url":"https://github.com/demml/rusty-logger","last_synced_at":"2026-01-15T03:42:17.515Z","repository":{"id":193932331,"uuid":"689667440","full_name":"demml/rusty-logger","owner":"demml","description":"Fast Python logging library written in Rust, ready for production","archived":false,"fork":false,"pushed_at":"2025-03-22T13:12:49.000Z","size":805,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-29T15:46:07.693Z","etag":null,"topics":["logger","logging","production","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/demml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-10T14:38:34.000Z","updated_at":"2025-10-02T17:04:46.000Z","dependencies_parsed_at":"2023-09-10T21:25:38.194Z","dependency_job_id":"79d88730-066d-4f1c-bc55-b9c94eee4533","html_url":"https://github.com/demml/rusty-logger","commit_stats":null,"previous_names":["thorrester/rusty-logger","demml/rusty-logger"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/demml/rusty-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demml%2Frusty-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demml%2Frusty-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demml%2Frusty-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demml%2Frusty-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/demml","download_url":"https://codeload.github.com/demml/rusty-logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demml%2Frusty-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"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":["logger","logging","production","python","rust"],"created_at":"2026-01-15T03:42:16.950Z","updated_at":"2026-01-15T03:42:17.509Z","avatar_url":"https://github.com/demml.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/thorrester/rusty-logger/blob/main/img/rusty-logger-logo.png?raw=true\"  width=\"767\" height=\"159\" alt=\"rusty logger logo\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Attention\n\n## This crate/library is currently undergoing re-writes.\n\n\n[![Lints-Tests](https://github.com/thorrester/rusty-logger/actions/workflows/lint-testing.yml/badge.svg?branch=main)](https://github.com/thorrester/rusty-logger/actions/workflows/lint-testing.yml)\n[![codecov](https://codecov.io/gh/thorrester/rusty-logger/graph/badge.svg?token=RVDMQRUEHT)](https://codecov.io/gh/thorrester/rusty-logger)\n\n## Rusty Logger\n\nSimple, opinionated and fast python logging. `Rusty-Logger` is a thin python wrapper for `Rust's` `tracing` library that provides a *mostly* drop-in replacement for `python's` default logging.\n\n## Table of contents\n\n- [Attention](#attention)\n  - [This crate/library is currently undergoing re-writes.](#this-cratelibrary-is-currently-undergoing-re-writes)\n  - [Rusty Logger](#rusty-logger)\n  - [Table of contents](#table-of-contents)\n  - [Supported Configuration](#supported-configuration)\n  - [Constraints](#constraints)\n  - [Show Me The Code!](#show-me-the-code)\n    - [Basic Usage](#basic-usage)\n    - [JSON](#json)\n    - [Log to file](#log-to-file)\n    - [Record multiple places at once](#record-multiple-places-at-once)\n  - [Additional examples](#additional-examples)\n  - [Performance](#performance)\n  - [Contributing](#contributing)\n\n## Supported Configuration\n\n| Arg  | Description | Default |\n| ------------- | :-------------:| :-------------: |\n| `stdout`  | Log to stdout  | `True` |\n| `stderr`  | Log to stderr  | `False` |\n| `level`  | Level to log  | `INFO` |\n| `app_env`  | Application environment (APP_ENV env var)  | `development` |\n| `lock_guard`  | Whether to lock logger to current context  | `False` |\n| `thread_id`  | Whether to display the thread id  | `False` |\n| `color`  | Whether to enable ansi coloring of logs for standard logger  | `False` |\n| `time_format` | Custom time format for logger | `[year]-[month]-[day]T[hour repr:24]:[minute]:[second]::[subsecond digits:4]` |\n| `json_config`  | `JsonConig`  | `None` |\n| `json_config.flatten`  | Whether to flatten any passed fields  | `True` |\n| `file_config`  | `LogFileConfig`  | `None` |\n| `file_config.filename`  | Filename for log  | `log/logs.log` |\n| `file_config.rotate`  | File rotation specification. `daily`, `hourly`, `minutely` or `never`  | `never` |\n\n## Constraints\n\nTime is currently limited to UTC; however, you can customize time format to your liking using the `time_format` arg. Please refer to (time docs)[https://time-rs.github.io/book/api/format-description.html] for formatting guidelines. In addition, because `Rusty-Logger` calls `Rust` directly, it's not currently possible to pull the specific line number where logging takes place unless python is directly used (if you're even interested in this feature :smile:). If you'd like to see this feature implemented, and you want to contribute, please refer to the [contributing](https://github.com/thorrester/rusty-logger/blob/main/CONTRIBUTING.md) guide.\n\nIn addition, `Rusty-Logger` is a *mostly* drop-in replacement, meaning that you may need to make some minor changes to your existing code. For example, `Rusty-Logger` does not support current python lazy formatting (e.g. `logger.info(\"Number: %s\", 10)`). Instead, `Rusty-Logger` uses Rust's default bracket ({}) formatting.\n\n```python\n# This is not supported\nlogger.info(\"Number: %s\", 10)\n\n# This is supported\nlogger.info(\"Number: {}\", 10)\n```\n\n## Show Me The Code!\n\n### Basic Usage\n\n```python\nfrom rusty_logger import Logger\n\nlogger = Logger.get_logger(__file__)\nlogger.info(\"Loggy McLogface\")\n```\n\noutput\n```shell\n2023-10-18T00:11:43::3194  INFO Loggy McLogface app_env=\"development\" name=\"your_file.py\"\n``` \n\n### JSON\n\n```python\nfrom rusty_logger import Logger, LogConfig, JsonConfig\n\nlogger = Logger.get_logger(__file__, LogConfig(json_config=JsonConfig()))\nlogger.info(\"Loggy McLogface logs\")\n```\n\noutput\n```shell\n{\"timestamp\":\"2023-10-18T00:10:59::9732\",\"level\":\"INFO\",\"message\":\"Loggy McLogface logs\",\"app_env\":\"development\",\"name\":\"your_file.py\"}\n```\n\n### Log to file\n\n```python\nfrom rusty_logger import Logger, LogConfig, JsonConfig, LogLevel, LogFileConfig\n\nlogger = Logger.get_logger(\n    name=__file__,\n    config=LogConfig(\n        stdout=False,\n        level=LogLevel.WARN,\n        json_config=JsonConfig(),\n        file_config=LogFileConfig(filename=\"logs/test.log\"),\n    ),\n)\nlogger.warning(\"Loggy McLogface logs logs\")\n```\n\noutput from `log/test.log`\n```shell\n{\"timestamp\":\"2023-10-18T00:10:10::9364\",\"level\":\"WARN\",\"message\":\"Loggy McLogface logs logs\",\"app_env\":\"development\",\"name\":\"your_file.py\"}\n\n```\n\n\n### Record multiple places at once\n\n```python\nfrom rusty_logger import Logger, LogConfig, JsonConfig, LogMetadata, LogLevel, LogFileConfig\n\nlogger = Logger.get_logger(\n    __file__,\n    LogConfig(\n        stdout=True,\n        level=LogLevel.ERROR,\n        json_config=JsonConfig(),\n        file_config=LogFileConfig(filename=\"logs/test.log\")\n    ),\n)\nlogger.error(\"Loggy McLogface logs logs that are logs\")\n```\n\noutput\n```shell\n{\"timestamp\":\"2023-10-18T00:09:32::4053\",\"level\":\"ERROR\",\"message\":\"Loggy McLogface logs logs that are logs\",\"app_env\":\"development\",\"name\":\"your_file.py\"}\n```\n## Additional examples\n\nFor additional examples, please see the [examples](https://github.com/thorrester/rusty-logger/tree/main/examples) directory which contains timed example of vanilla logger vs `Rusty-Logger`, `python-json-logger` vs `Rusty-Logger` as well as a multi-worker API example.\n\n## Performance\nWhy would we do this when python logging is fine? Because we wanted something faster :smile:. From our own benchmarks, `Rusty-Logger` tends to be ~`4x` faster than vanilla python logging and ~`8x` faster than vanilla `JSON` logging. And while speed may not be mission critical for a few thousands logs, it can be for millions, which many companies deal with on a daily basis. Time is money and compute, and we want to save you both :moneybag: :computer:.\n\n## Contributing\nWhile `Rusty-Logger` is production ready out of the box, it is still in it's infancy and is ripe for additional contributions. If you'd like to contribute, please see the [contributing](https://github.com/thorrester/rusty-logger/blob/main/CONTRIBUTING.md) guide.\n\n\nThank You!!! :heart: :heart: :heart:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemml%2Frusty-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemml%2Frusty-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemml%2Frusty-logger/lists"}