{"id":27438452,"url":"https://github.com/jwillbold/slog_mongodb","last_synced_at":"2026-04-29T15:41:36.347Z","repository":{"id":57667718,"uuid":"250901293","full_name":"jwillbold/slog_mongodb","owner":"jwillbold","description":"MongoDB drain for slog-rs","archived":false,"fork":false,"pushed_at":"2020-03-29T15:15:45.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T04:13:11.760Z","etag":null,"topics":["logging","mongodb","rust","slog-rs"],"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/jwillbold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-28T21:55:43.000Z","updated_at":"2020-03-29T16:53:03.000Z","dependencies_parsed_at":"2022-09-26T20:31:59.926Z","dependency_job_id":null,"html_url":"https://github.com/jwillbold/slog_mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jwillbold/slog_mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillbold%2Fslog_mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillbold%2Fslog_mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillbold%2Fslog_mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillbold%2Fslog_mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwillbold","download_url":"https://codeload.github.com/jwillbold/slog_mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwillbold%2Fslog_mongodb/sbom","scorecard":{"id":545297,"data":{"date":"2025-08-11","repo":{"name":"github.com/jwillbold/slog_mongodb","commit":"1f2acd480f0e312a156acc3813a312614f345752"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T09:20:47.813Z","repository_id":57667718,"created_at":"2025-08-20T09:20:47.813Z","updated_at":"2025-08-20T09:20:47.813Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32432905,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T13:34:34.882Z","status":"ssl_error","status_checked_at":"2026-04-29T13:34:29.830Z","response_time":110,"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":["logging","mongodb","rust","slog-rs"],"created_at":"2025-04-14T20:39:40.938Z","updated_at":"2026-04-29T15:41:36.318Z","avatar_url":"https://github.com/jwillbold.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/jwillbold/slog_mongodb.svg?token=hPh87VpFt3MQPwdySdkS\u0026branch=master)](https://travis-ci.com/jwillbold/slog_mongodb)\r\n[![codecov](https://codecov.io/gh/jwillbold/slog_mongodb/branch/master/graph/badge.svg)](https://codecov.io/gh/jwillbold/slog_mongodb)\r\n\r\n# slog_mongodb\r\n\r\nMongoDB extension for Rust's logging library [slog-rs](https://github.com/slog-rs/slog).\r\nSerializes [slog](https://github.com/slog-rs/slog) messages to [BSON](https://github.com/mongodb/bson-rust) documents and stores them in a [MongoDB collection](https://github.com/mongodb/mongo-rust-driver).\r\nTo reduce the stress on the database, the logged messages are buffered and only sent in configurable time intervals.\r\n\r\n## Usage\r\n\r\n```Rust\r\nuse slog::*;\r\n\r\nfn main() {\r\n    let client = mongodb::Client::with_uri_str(\"mongodb://localhost:27017/\").unwrap();\r\n    let db = client.database(\"some_db\");\r\n    let logs = db.collection(\"logs\");\r\n\r\n    let drain = slog_mongodb::MongoDBDrain::new(logs, std::time::Duration::from_secs(5)).fuse();\r\n    let drain = slog_async::Async::new(drain).build().fuse();\r\n\r\n    let log = Logger::root(drain, o!());\r\n    info!(log, \"Hello MongoDB!\");\r\n}\r\n```\r\n\r\n### Notes\r\nBy default, the logged messages contain the following values:\r\n - \"ts\": RFC3339 timestamp\r\n - \"level\": \"TRCE\", \"INFO\", \"WARN\", \"ERRO\" or \"CRIT\"\r\n - \"leveli\": 4 - 0\r\n - \"msg\": the log message\r\n\r\nThis behavior can be changed by constructing the drain as follows:\r\n\r\n```Rust\r\nuse slog::*;\r\n\r\nfn main() {\r\n    let client = mongodb::Client::with_uri_str(\"mongodb://localhost:27017/\").unwrap();\r\n    let db = client.database(\"some_db\");\r\n    let logs = db.collection(\"logs\");\r\n\r\n    let drain = MongoDBDrainBuilder::new(logs, std::time::Duration::from_secs(5))\r\n            .add_key_value(o!(\"key\" =\u003e \"value\")).build();\r\n    let drain = slog_async::Async::new(drain).build().fuse();\r\n\r\n    let log = Logger::root(drain, o!());\r\n    info!(log, \"Hello MongoDB!\");\r\n}\r\n```\r\n\r\n### Credits\r\nThe serde serialization as well as the overall design is copied from [slog-json](https://github.com/slog-rs/json).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillbold%2Fslog_mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwillbold%2Fslog_mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwillbold%2Fslog_mongodb/lists"}