{"id":18716394,"url":"https://github.com/novemberfiveco/skidder-python","last_synced_at":"2025-11-10T10:30:22.860Z","repository":{"id":48250448,"uuid":"375024957","full_name":"novemberfiveco/skidder-python","owner":"novemberfiveco","description":"November Five's logging framework for Python","archived":false,"fork":false,"pushed_at":"2023-09-14T07:43:02.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-28T10:29:00.029Z","etag":null,"topics":["logging","logging-framework","logging-library","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/novemberfiveco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-08T13:46:44.000Z","updated_at":"2022-11-14T13:07:40.000Z","dependencies_parsed_at":"2024-11-07T13:12:41.631Z","dependency_job_id":"8d4b91bf-e7d9-4638-853a-14faea8418fc","html_url":"https://github.com/novemberfiveco/skidder-python","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novemberfiveco%2Fskidder-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novemberfiveco%2Fskidder-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novemberfiveco%2Fskidder-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/novemberfiveco%2Fskidder-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/novemberfiveco","download_url":"https://codeload.github.com/novemberfiveco/skidder-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239581802,"owners_count":19662958,"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":["logging","logging-framework","logging-library","python"],"created_at":"2024-11-07T13:12:32.638Z","updated_at":"2025-11-10T10:30:22.806Z","avatar_url":"https://github.com/novemberfiveco.png","language":"Python","readme":"# Skidder\n\nSkidder will drag your logs to where they need to go. A small, uniform and extensible logging library, implemented across major technologies.\n\n## Installation\n```commandline\npip install git+https://github.com/novemberfiveco/skidder-python@3.0.0\n```\nor using poetry\n```commandline\npoetry add git+https://github.com/novemberfiveco/skidder-python@3.0.0\n```\n\n## Usage\n\n### Setup\n\nConfigure logging using the `configure_logging()` function once at the beginning of your program.\nYou can pass a value for the `component` field as required by N5's standards.\n```python\nfrom skidder import configure_logging\n\nconfigure_logging(component='my-backend-service')\n\n# note that we configure logging outside the AWS Lambda handler function\ndef handler(event, context):\n    ...\n \n```\n\n### Logging events\n\nNow that the logger is configured, just use the `get_logger()` function from *structlog* to get the correctly configured\nlogger anywhere inside your project.\n\n```python\nfrom structlog import get_logger\n\nlog = get_logger()\n\nlog.debug(\"This is a debug log\")\nlog.info(\"This is an info log\")\nlog.warn(\"This is a warn log\")\nlog.error(\"This is an error log\")\nlog.critical(\"This is a critical log\")\n```\n\nWhen running this program locally, you receive pretty formatted log output:\n\n````commandline\n2021-07-12T18:04:48.248064Z [info     ] This is an info log                             component=foo environment=None source=application type=event\n````\n\nHowever, in an actual environment, you should set the `ENV` environment variable, which will enable JSON logging:\n\n````json5\n{\"component\": \"foo\", \"environment\": \"dev\", \"level\": \"info\", \"message\": \"This is an info log\", \"source\": \"application\", \"timestamp\": \"2021-07-12T18:07:08.674527Z\", \"type\": \"event\"}\n````\n\n### Logging exceptions\n\nYou can pass an exception parameter to include a stacktrace in the log event:\n\n````python\ntry:\n    raise Exception\nexcept Exception as e:\n    log.error(\"API call to external service X failed due to timeout\", exception=e)\n````\n\n### Including additional fields\n\nYou can also pass extra parameters to populate the `data` field with additional structured information:\n\n````python\nlog.info(\"Synchronizing product catalog to store\", store_id='store-123')\n````\n\n\n### Setting a request ID on your log events\n\nWhenever possible, you should set the `requestId` field on log events to link them to a specific request for easy investigation.\n\nYou can manually set or unset:\n\n```python\nfrom structlog import bind_request_id, unbind_request_id\n\nlog.info(\"This log event is not part of a request\")\n\ndef handler(event, context):\n    bind_request_id(\"my-request-123\")\n    log.info(\"This log event is part of my-request-123\")\n    unbind_request_id()\n```\n\nFor convenience, there is also a decorator that automatically (un)binds a request ID whenever your function is called. By default, a new UUID is generated.\n```python\nfrom structlog import request_context_logging\n\nlog.info(\"This log event is not part of a request\")\n\n@request_context_logging\ndef handler(event, context):\n    log.info(\"This log event is part of a request\")\n```\n\nYou can also pass a function that provides the request ID (for example you might want to get it from an HTTP request header\nto continue a request spanning multiple distributed services):\n```python\nfrom structlog import request_context_logging\n\nlog.info(\"This log event is not part of a request\")\n\ndef request_id_from_header(event, context):\n    return event[\"headers\"][\"X-Trace-ID\"]\n\n@request_context_logging(request_id_provider=request_id_from_header)\ndef handler(event, context):\n    log.info(\"This log event is part of a request\")\n```\n\n### Adding a LUMIGO_LOG prefix to error logs\nWhen you want to have your error logs get noticed by Lumigo, they need a LUMIGO_LOG prefix. \nThis can be enabled by enabling the corresponding flag:\n```python\nfrom skidder import configure_logging\n\nconfigure_logging(component='my-backend-service', enable_lumigo_prefix=True)\n \n```\n\n\n\n## Changelog\n\n- 3.1.1\n  - removed Lumigo prefix from warning logs\n- 3.1.0\n  - added Lumigo prefix to error logs\n- 3.0.0\n  - rename repo to Skidder\n- 2.0.2\n  - set minimum python version to 3.7\n- 2.0.1\n  - Added check for IS_LOCAL env variable to check local development env\n- 2.0.0\n    - Pin structlog dependency (because using private function that is not part of public structlog API and can change without notice)\n    - Set minimum logging level to DEBUG when in dev environment\n    - Log uncaught exceptions\n    - Intercept \u0026 process STDLIB logging\n    - Populate type field dynamically\n    - Populate source field dynamically\n    - Refactor into functions\n    - Allow binding request ID field\n    - Allow binding component field\n    - Disable JSON logging \u0026 enable pretty logging when executing locally\n    - Nest extra fields under the 'data' key\n- 1.0.0\n    - basic setup according to N5 standard.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovemberfiveco%2Fskidder-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnovemberfiveco%2Fskidder-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnovemberfiveco%2Fskidder-python/lists"}