{"id":50277855,"url":"https://github.com/imsweb/django-graylog","last_synced_at":"2026-05-27T22:02:10.475Z","repository":{"id":57420307,"uuid":"254441542","full_name":"imsweb/django-graylog","owner":"imsweb","description":"Django middleware for logging to Graylog.","archived":false,"fork":false,"pushed_at":"2025-08-22T17:15:16.000Z","size":60,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-14T14:03:00.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/imsweb.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":"2020-04-09T17:52:28.000Z","updated_at":"2025-08-22T17:15:19.000Z","dependencies_parsed_at":"2023-01-22T01:54:53.500Z","dependency_job_id":null,"html_url":"https://github.com/imsweb/django-graylog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imsweb/django-graylog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fdjango-graylog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fdjango-graylog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fdjango-graylog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fdjango-graylog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imsweb","download_url":"https://codeload.github.com/imsweb/django-graylog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fdjango-graylog/sbom","scorecard":{"id":486467,"data":{"date":"2025-08-11","repo":{"name":"github.com/imsweb/django-graylog","commit":"c493fe25ec0e63574ebd4b9a380db30c475d1e6e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/django-graylog/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/django-graylog/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/django-graylog/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/django-graylog/ci.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:16","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:42","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"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":"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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 'main'"],"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-19T17:56:59.513Z","repository_id":57420307,"created_at":"2025-08-19T17:56:59.513Z","updated_at":"2025-08-19T17:56:59.513Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":[],"created_at":"2026-05-27T22:02:09.592Z","updated_at":"2026-05-27T22:02:10.467Z","avatar_url":"https://github.com/imsweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-graylog\n\nA Django middleware for logging requests to [Graylog](https://www.graylog.org).\n\n\n## Installation\n\n`pip install django-graylog`\n\nUsing an HTTP/HTTPS requires the [requests](https://requests.readthedocs.io/en/master/)\nmodule, which can be included with `pip install django-graylog[http]`.\n\nParsing user agents requires the [ua_parser](https://github.com/ua-parser/uap-python)\nmodule, which can be included with `pip install django-graylog[ua]`.\n\nAll optional libraries may be included using `pip install django-graylog[all]`.\n\n\n## Configuration\n\nSimply add `django_graylog.GraylogMiddleware` to your `MIDDLEWARE` setting, after\n`django.middleware.common.CommonMiddleware`. By default, the middleware does nothing\nunless `GRAYLOG_ENDPOINT` is set (see below).\n\n\n### Settings\n\n* `GRAYLOG_ENDPOINT` - An HTTP, HTTPS, UDP, or TCP endpoint to send GELF logs to. For\n  example:\n    - `http://yourserver:12201/gelf`\n    - `udp://yourserver:12201`\n    - `tcp://yourserver:12201`\n* `GRAYLOG_NODE` - The middleware sends a `_node` field that defaults to\n  `socket.gethostname`. Set this to override it.\n* `GRAYLOG_LEVEL` - The default `level` to send for log entries. Defaults to 6 (INFO).\n* `GRAYLOG_TIMEOUT` - Timeout (in seconds) for sending log entries to Graylog. Defaults\n  to `0.25` seconds.\n* `GRAYLOG_FIELDS` - Extra fields to send for each request (not prefixed with\n  underscores). Defaults to `{}`.\n* `GRAYLOG_HEADERS` - `True` to include all HTTP request headers (except sensitive\n  headers like `Authorization` and `Cookie` - see below), otherwise a list of headers to\n  be included. Defaults to `[]`.\n* `GRAYLOG_EXCLUDE_HEADERS` - A list of headers to exclude when `GRAYLOG_HEADERS` is\n  `True`. Defaults to `[\"authorization\", \"cookie\", \"proxy-authorization\"]`.\n* `GRAYLOG_USER_AGENT` - `True` to parse out User-Agent header into separate fields\n  using [ua_parser](https://github.com/ua-parser/uap-python) (default is `False`).\n* `GRAYLOG_REFERER` - `True` to parse out the referer domain (default is `False`) into a\n  separate field.\n* `GRAYLOG_USERNAME` - `True` to include `request.user.get_username()` (default is\n  `False`).\n* `GRAYLOG_TIMING` - `True` to include request timing information (the default), `False`\n  to disable.\n* `GRAYLOG_FILTERS` - A dictionary of filters to exclude records from being logged. Each\n  key is a field name, and each value is a list of regegular expressions to exclude. For\n  example:\n    - `{\"host\": [r\"media.example.com\"]}` - Skips logging of requests to the\n      `media.example.com` domain.\n    - `{\"path\": [r\"^/_\"]}` - Skips logging of requests to paths starting with `_`.\n    - `{\"ip\": \"192\\.168\\.\"}` - Skips logging of requests from `192.168.*` addresses.\n      Using a string instead of a list works for a single regular expression.\n* `GRAYLOG_EXCEPTION_MESSAGES` - Whether to include exception messages in data sent to\n  Graylog. Setting to `False` will strip the last line from stack traces (in case the\n  line includes a literal message), and not send the `_exception_message` field.\n  Defaults to `True`.\n* `GRAYLOG_FACILITY` - Sent as `_facility`, and used as the default logger name for\n  logging messages sent via `request.graylog`.\n* `GRAYLOG_TIMESTAMP` - Whether to include a `timestamp` field in data sent to Graylog.\n  Setting to `False` means Graylog will infer the current time when it receives log\n  entries. Defaults to `True`.\n* `GRAYLOG_IP` - Whether to include the IP address of requests. Defaults to `True`.\n\n\n## Advanced Usage\n\nIn addition to the standard logging middleware, `django_graylog` installs an object on\nyour request objects (`request.graylog`) that has standard logging methods for recording\nper-request logs. You may also set custom keys on this object\n(`request.graylog[\"key\"] = \"value\"`) that will be included in log entries. For example:\n\n```python\ndef homepage(request):\n    request.graylog[\"user\"] = request.user.user_name\n    request.graylog.info(\"Rendered homepage for {user}\", user=request.user.user_name)\n```\n\nIf you want standard Python logging calls during a request to be logged into Graylog as\nwell, `django_graylog` comes with a `GraylogRequestHandler` logging handler that tracks\nthe current request and associates logging to it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsweb%2Fdjango-graylog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimsweb%2Fdjango-graylog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsweb%2Fdjango-graylog/lists"}