{"id":19230378,"url":"https://github.com/elmarx/actix-slog","last_synced_at":"2025-04-21T03:30:55.147Z","repository":{"id":37987705,"uuid":"277483693","full_name":"elmarx/actix-slog","owner":"elmarx","description":"structured logging for actix-web","archived":false,"fork":false,"pushed_at":"2023-02-27T01:06:37.000Z","size":16,"stargazers_count":8,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T22:53:29.136Z","etag":null,"topics":["actix-web","logging","rust","slog"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/elmarx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-06T08:20:18.000Z","updated_at":"2022-04-24T20:37:01.000Z","dependencies_parsed_at":"2023-02-12T19:01:17.421Z","dependency_job_id":null,"html_url":"https://github.com/elmarx/actix-slog","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Factix-slog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Factix-slog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Factix-slog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elmarx%2Factix-slog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elmarx","download_url":"https://codeload.github.com/elmarx/actix-slog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223848306,"owners_count":17213598,"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":["actix-web","logging","rust","slog"],"created_at":"2024-11-09T15:37:56.498Z","updated_at":"2024-11-09T15:37:57.190Z","avatar_url":"https://github.com/elmarx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Rust build](https://github.com/elmarx/actix-slog/workflows/Rust/badge.svg)](https://github.com/elmarx/actix-slog/actions?query=workflow%3ARust) [![crates.io badge](https://img.shields.io/crates/v/actix-slog.svg)](https://crates.io/crates/actix-slog) [![docs.rs badge](https://docs.rs/actix-slog/badge.svg)](https://docs.rs/actix-slog)\n\n# Structured (access-) logging for actix-web\n\nProvides a [middleware](https://docs.rs/actix-web/2.0.0/actix_web/struct.App.html#method.wrap) (`StructuredLogger`), \nsimilar to [actix_web::middleware:Logger](https://docs.rs/actix-web/2.0.0/actix_web/middleware/struct.Logger.html),\nexcept that it uses [slog](https://crates.io/crates/slog) and thus enables JSON-formatted logging (via [slog-json](https://crates.io/crates/slog-json)).\n\nOf course [slog's compact terminal output](https://github.com/slog-rs/slog#terminal-output-example) is a nice add-on, \neven if you're just out for JSON-logging.\n\n## Usage\n\nSee [server_json](examples/server_compact.rs) and [server_compact](examples/server_compact.rs) for working examples.\n\n```rust\n  let logger: slog::Logger = unimplemented!();\n\n  HttpServer::new(move || {\n    App::new()\n      .wrap(\n        StructuredLogger::new(logger.new(o!(\"log_type\" =\u003e \"access\"))),\n      )\n    })\n    .bind(\"[::1]:8080\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmarx%2Factix-slog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmarx%2Factix-slog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmarx%2Factix-slog/lists"}