https://github.com/marcy-terui/ddlogs
Datadog Logs logging handler and utilities for Python
https://github.com/marcy-terui/ddlogs
datadog datadog-logs logging pypi python
Last synced: about 1 year ago
JSON representation
Datadog Logs logging handler and utilities for Python
- Host: GitHub
- URL: https://github.com/marcy-terui/ddlogs
- Owner: marcy-terui
- License: mit
- Created: 2018-10-10T01:24:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-02T02:28:14.000Z (over 7 years ago)
- Last Synced: 2025-05-19T16:48:49.703Z (about 1 year ago)
- Topics: datadog, datadog-logs, logging, pypi, python
- Language: Python
- Homepage: https://pypi.org/project/ddlogs/
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ddlogs
=======
[](https://pypi.python.org/pypi/ddlogs)
# Description
Datadog logs logging handler and utilities.
# Requirements
- Python3.6 or higher
- pip
# Installation
## PyPI
```sh
pip install ddlogs
```
# Usage
```python
import logging
import ddlogs
logger = logging.getLogger('test')
h = ddlogs.DatadogLogsHandler(
api_key='your-datadog-api-key', # default: os.environ.get('DD_API_KEY')
source_category='samplecategory', # default: "ddlogs"
source='samplesource', # default: "python"
service='sampleservice', # default: logger.name
host='localhost') # default: gethostname()
h.setFormatter(ddlogs.DictFormatter())
logger.addHandler(h)
logger.error({'foo': 'bar'})
```
# Output

Development
-----------
- Source hosted at [GitHub](https://github.com/marcy-terui/ddlogs)
- Report issues/questions/feature requests on [GitHub
Issues](https://github.com/marcy-terui/ddlogs/issues)
Pull requests are very welcome! Make sure your patches are well tested.
Ideally create a topic branch for every separate change you make. For
example:
1. Fork the repo
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
Authors
-------
Created and maintained by [Masashi Terui](https://github.com/marcy-terui) ()
License
-------
MIT License (see [LICENSE](https://github.com/marcy-terui/ddlogs/blob/master/LICENSE))