{"id":15654769,"url":"https://github.com/idlesign/systemd-logging","last_synced_at":"2025-10-17T09:17:12.244Z","repository":{"id":54851872,"uuid":"215022433","full_name":"idlesign/systemd-logging","owner":"idlesign","description":"Simplifies logging for systemd","archived":false,"fork":false,"pushed_at":"2022-02-04T12:40:35.000Z","size":89,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-16T00:13:02.568Z","etag":null,"topics":["logging","python","python3","systemd"],"latest_commit_sha":null,"homepage":"https://github.com/idlesign/systemd-logging","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-14T11:10:30.000Z","updated_at":"2024-02-02T07:59:54.000Z","dependencies_parsed_at":"2022-08-14T04:50:12.889Z","dependency_job_id":null,"html_url":"https://github.com/idlesign/systemd-logging","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fsystemd-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fsystemd-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fsystemd-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fsystemd-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/systemd-logging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251848670,"owners_count":21653731,"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","python","python3","systemd"],"created_at":"2024-10-03T12:54:02.119Z","updated_at":"2025-10-17T09:17:07.188Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"systemd-logging\n===============\nhttps://github.com/idlesign/systemd-logging\n\n|release| |lic| |coverage|\n\n.. |release| image:: https://img.shields.io/pypi/v/systemd-logging.svg\n    :target: https://pypi.python.org/pypi/systemd-logging\n\n.. |lic| image:: https://img.shields.io/pypi/l/systemd-logging.svg\n    :target: https://pypi.python.org/pypi/systemd-logging\n\n.. |coverage| image:: https://img.shields.io/coveralls/idlesign/systemd-logging/master.svg\n    :target: https://coveralls.io/r/idlesign/systemd-logging\n\n\nDescription\n-----------\n\n*Simplifies logging for systemd*\n\n**Requires Python 3.6+**\n\n* No need to compile (pure Python), uses ``libsystemd.so``.\n* Simplified configuration.\n* Just logging. Nothing more.\n\n\nUsage\n-----\n\n.. code-block:: python\n\n    import logging\n\n    from systemdlogging.toolbox import init_systemd_logging\n\n    # This one line in most cases would be enough.\n    # By default it attaches systemd logging handler to a root Python logger.\n    init_systemd_logging()  # Returns True if initialization went fine.\n\n    # Now you can use logging as usual.\n    logger = logging.getLogger(__name__)\n    logger.setLevel(logging.DEBUG)\n\n    logger.debug('My debug message')\n\n    try:\n        raise ValueError('Log me please')\n\n    except ValueError:\n        # Additional context can be passed in extra.context.\n        logger.exception('Something terrible just happened', extra={\n            'message_id': True,  # Generate message ID automatically.\n            'context': {\n                'FIELD1': 'one',\n                'FIELD2': 'two',\n            }\n        }, stack_info=True)\n\n\nRead the docs to find out more.\n\n\nDocumentation\n-------------\n\nhttps://systemd-logging.readthedocs.org/\n\nDebug runs\n~~~~~~~~~~\n\n1. Run your script with:\n\n  .. code-block::\n\n      $ sudo systemd-run -u debugme -t /usr/bin/python /home/my/testme.py\n\n2. Watch its journal with:\n\n  .. code-block::\n\n      $ journalctl -u debugme -f -o verbose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fsystemd-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fsystemd-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fsystemd-logging/lists"}