%global _empty_manifest_terminate_build 0 Name: python-logdna Version: 1.18.6 Release: 1 Summary: A Python Package for Sending Logs to LogDNA License: MIT URL: https://github.com/logdna/python Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3b/29/38ecf30003b6b7816975d1b2cd4f586223ccc80f300766529f64db62a17a/logdna-1.18.6.tar.gz BuildArch: noarch Requires: python3-requests %description * [Installation](#installation) * [Setup](#setup) * [Usage](#usage) * [Usage with fileConfig](#usage-with-fileconfig) * [API](#api) * [LogDNAHandler(key: string, [options: dict])](#logdnahandlerkey-string-options-dict) * [key](#key) * [options](#options) * [log(line, [options])](#logline-options) * [line](#line) * [options](#options-1) * [Development](#development) * [Scripts](#scripts) * [License](#license) ## Installation ```bash $ pip install logdna ``` ## Setup ```python import logging from logdna import LogDNAHandler import os # Set your key as an env variable # then import here, its best not to # hard code your key! key=os.environ['INGESTION_KEY'] log = logging.getLogger('logdna') log.setLevel(logging.INFO) options = { 'hostname': 'pytest', 'ip': '10.0.1.1', 'mac': 'C0:FF:EE:C0:FF:EE' } # Defaults to False; when True meta objects are searchable options['index_meta'] = True options['custom_fields'] = 'meta' test = LogDNAHandler(key, options) log.addHandler(test) log.warning("Warning message", extra={'app': 'bloop'}) log.info("Info message") ``` _**Required**_ * [LogDNA Ingestion Key](https://app.logdna.com/manage/profile) _**Optional**_ * Hostname - ([string][]) * MAC Address - ([string][]) * IP Address - ([string][]) * Index Meta - ([bool][]) - formatted as `options['index_meta']` ## Usage After initial setup, logging is as easy as: ```python # Simplest use case log.info('My Sample Log Line') # Add a custom level log.info('My Sample Log Line', extra={ 'level': 'MyCustomLevel' }) # Include an App name with this specific log log.info('My Sample Log Line', extra={ 'level': 'Warn', 'app': 'myAppName'}) # Pass associated objects along as metadata meta = { 'foo': 'bar', 'nested': { 'nest1': 'nested text' } } opts = { 'level': 'warn', 'meta': meta } log.info('My Sample Log Line', extra=opts) ``` ### Usage with fileConfig To use [LogDNAHandler](#logdnahandlerkey-string-options-dict) with [fileConfig][] (e.g., in a Django `settings.py` file): ```python import os import logging from logdna import LogDNAHandler # required to register `logging.handlers.LogDNAHandler` LOGGING = { # Other logging settings... 'handlers': { 'logdna': { 'level': logging.DEBUG, 'class': 'logging.handlers.LogDNAHandler', 'key': os.environ.get('LOGDNA_INGESTION_KEY'), 'options': { 'app': '', 'env': os.environ.get('ENVIRONMENT'), 'index_meta': , }, }, }, 'loggers': { '': { 'handlers': ['logdna'], 'level': logging.DEBUG }, }, } ``` (This example assumes you have set environment variables for `ENVIRONMENT` and `LOGDNA_INGESTION_KEY`.) ## API ### LogDNAHandler(key: [string][], [options: [dict][]]) #### key * _**Required**_ * Type: [string][] * Values: `` The [LogDNA API Key](https://app.logdna.com/manage/profile) associated with your account. #### options ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default app named that is included in every every log line sent through this instance. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default env passed along with every log sent through this instance. ##### hostname * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default hostname passed along with every log sent through this instance. ##### include_standard_meta * _Optional_ * Type: [bool][] * Default: `False` Python [LogRecord][] objects includes language-specific information that may be useful metadata in logs. Setting `include_standard_meta` to `True` automatically populates meta objects with `name`, `pathname`, and `lineno` from the [LogRecord][]. *WARNING* This option is deprecated and will be removed in the upcoming major release. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects are stringified and not searchable, and are only displayed for informational purposes. If this option is set to True then meta objects are parsed and searchable up to three levels deep. Any fields deeper than three levels are stringified and cannot be searched. *WARNING* If this option is True, your metadata objects MUST have consistent types across all log messages or the metadata object might not be parsed properly. ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The default level passed along with every log sent through this instance. ##### verbose * _Optional_ * Type: [string][] or [bool][] * Default: `True` * Values: `False` or any level Sets the verbosity of log statements for failures. ##### request_timeout * _Optional_ * Type: [int][] * Default: `30000` The amount of time (in ms) the request should wait for LogDNA to respond before timing out. ##### tags * _Optional_ * Type: [list][]<[string][]> * Default: `[]` List of tags used to dynamically group hosts. More information on tags is available at [How Do I Use Host Tags?](https://docs.logdna.com/docs/logdna-agent#section-how-do-i-use-host-tags-) ##### url * _Optional_ * Type: [string][] * Default: `'https://logs.logdna.com/logs/ingest'` A custom ingestion endpoint to stream log lines into. ##### custom_fields * _Optional_ * Type: [list][]<[string][]> * Default: `['args', 'name', 'pathname', 'lineno']` List of fields out of `record` object to include in the `meta` object. By default, `args`, `name`, `pathname`, and `lineno` will be included. ##### log_error_response * _Optional_ * Type: [bool][] * Default: `False` Enables logging of the API response when an HTTP error is encountered ### log(line, [options]) #### line * _Required_ * Type: [string][] * Default: `''` The log line to be sent to LogDNA. #### options ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The level passed along with this log line. ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The app passed along with this log line. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The environment passed with this log line. ##### meta * _Optional_ * Type: [dict][] * Default: `None` A standard dictonary containing additional metadata about the log line that is passed. Please ensure values are JSON serializable. **NOTE**: Values that are not JSON serializable will be removed and the respective keys will be added to the `__errors` string. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects will be stringified and will not be searchable, but will be displayed for informational purposes. If this option is turned to true then meta objects will be parsed and will be searchable up to three levels deep. Any fields deeper than three levels will be stringified and cannot be searched. *WARNING* When this option is true, your metadata objects across all types of log messages MUST have consistent types or the metadata object may not be parsed properly! ##### timestamp * _Optional_ * Type: [float][] * Default: [time.time()][] The time in seconds since the epoch to use for the log timestamp. It must be within one day or current time - if it is not, it is ignored and time.time() is used in its place. ## Development This project makes use of the [poetry][] package manager for local development. ```shell $ poetry install ``` ### Scripts **lint** Run linting rules w/o attempting to fix them ```shell $ poetry run task lint ``` **lint:fix** Run lint rules against all local python files and attempt to fix where possible. ```shell $ poetry run task lint:fix ``` **test**: Runs all unit tests and generates coverage reports ```shell poetry run task test ``` ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Muaz Siddiqui

💻 📖 ⚠️

Samir Musali

💻 📖 ⚠️

vilyapilya

💻 🚧 ⚠️

Mike Hu

📖

Eric Satterwhite

💻 📖 ⚠️ 🔧

Łukasz Bołdys (Lukasz Boldys)

💻 🐛

Ryan

📖

Mike Huang

💻 🐛

Dan Maas

💻

DChai

📖

Jakob de Maeyer

💻

Andrey Babak

💻

Mike S

💻 📖

Brennan Ashton

💻

Christian Hotz-Behofsits

💻 🐛

Kurtiss Hare

🐛

Alexey Kinev

🐛

matthiasfru

🐛
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ## License MIT © [LogDNA](https://logdna.com/) Copyright © 2017 [LogDNA][], released under an MIT license. See the [LICENSE](./LICENSE) file and [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT) *Happy Logging!* [bool]: https://docs.python.org/3/library/stdtypes.html#boolean-values [dict]: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict [int]: https://docs.python.org/3/library/functions.html#int [float]: https://docs.python.org/3/library/functions.html#float [string]: https://docs.python.org/3/library/string.html [list]: https://docs.python.org/3/library/stdtypes.html#list [time.time()]: https://docs.python.org/3/library/time.html?#time.time [poetry]: https://python-poetry.org [LogDNA]: https://logdna.com/ [LogRecord]: https://docs.python.org/2/library/logging.html#logrecord-objects [fileConfig]: https://docs.python.org/2/library/logging.config.html#logging.config.fileConfig %package -n python3-logdna Summary: A Python Package for Sending Logs to LogDNA Provides: python-logdna BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-logdna * [Installation](#installation) * [Setup](#setup) * [Usage](#usage) * [Usage with fileConfig](#usage-with-fileconfig) * [API](#api) * [LogDNAHandler(key: string, [options: dict])](#logdnahandlerkey-string-options-dict) * [key](#key) * [options](#options) * [log(line, [options])](#logline-options) * [line](#line) * [options](#options-1) * [Development](#development) * [Scripts](#scripts) * [License](#license) ## Installation ```bash $ pip install logdna ``` ## Setup ```python import logging from logdna import LogDNAHandler import os # Set your key as an env variable # then import here, its best not to # hard code your key! key=os.environ['INGESTION_KEY'] log = logging.getLogger('logdna') log.setLevel(logging.INFO) options = { 'hostname': 'pytest', 'ip': '10.0.1.1', 'mac': 'C0:FF:EE:C0:FF:EE' } # Defaults to False; when True meta objects are searchable options['index_meta'] = True options['custom_fields'] = 'meta' test = LogDNAHandler(key, options) log.addHandler(test) log.warning("Warning message", extra={'app': 'bloop'}) log.info("Info message") ``` _**Required**_ * [LogDNA Ingestion Key](https://app.logdna.com/manage/profile) _**Optional**_ * Hostname - ([string][]) * MAC Address - ([string][]) * IP Address - ([string][]) * Index Meta - ([bool][]) - formatted as `options['index_meta']` ## Usage After initial setup, logging is as easy as: ```python # Simplest use case log.info('My Sample Log Line') # Add a custom level log.info('My Sample Log Line', extra={ 'level': 'MyCustomLevel' }) # Include an App name with this specific log log.info('My Sample Log Line', extra={ 'level': 'Warn', 'app': 'myAppName'}) # Pass associated objects along as metadata meta = { 'foo': 'bar', 'nested': { 'nest1': 'nested text' } } opts = { 'level': 'warn', 'meta': meta } log.info('My Sample Log Line', extra=opts) ``` ### Usage with fileConfig To use [LogDNAHandler](#logdnahandlerkey-string-options-dict) with [fileConfig][] (e.g., in a Django `settings.py` file): ```python import os import logging from logdna import LogDNAHandler # required to register `logging.handlers.LogDNAHandler` LOGGING = { # Other logging settings... 'handlers': { 'logdna': { 'level': logging.DEBUG, 'class': 'logging.handlers.LogDNAHandler', 'key': os.environ.get('LOGDNA_INGESTION_KEY'), 'options': { 'app': '', 'env': os.environ.get('ENVIRONMENT'), 'index_meta': , }, }, }, 'loggers': { '': { 'handlers': ['logdna'], 'level': logging.DEBUG }, }, } ``` (This example assumes you have set environment variables for `ENVIRONMENT` and `LOGDNA_INGESTION_KEY`.) ## API ### LogDNAHandler(key: [string][], [options: [dict][]]) #### key * _**Required**_ * Type: [string][] * Values: `` The [LogDNA API Key](https://app.logdna.com/manage/profile) associated with your account. #### options ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default app named that is included in every every log line sent through this instance. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default env passed along with every log sent through this instance. ##### hostname * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default hostname passed along with every log sent through this instance. ##### include_standard_meta * _Optional_ * Type: [bool][] * Default: `False` Python [LogRecord][] objects includes language-specific information that may be useful metadata in logs. Setting `include_standard_meta` to `True` automatically populates meta objects with `name`, `pathname`, and `lineno` from the [LogRecord][]. *WARNING* This option is deprecated and will be removed in the upcoming major release. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects are stringified and not searchable, and are only displayed for informational purposes. If this option is set to True then meta objects are parsed and searchable up to three levels deep. Any fields deeper than three levels are stringified and cannot be searched. *WARNING* If this option is True, your metadata objects MUST have consistent types across all log messages or the metadata object might not be parsed properly. ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The default level passed along with every log sent through this instance. ##### verbose * _Optional_ * Type: [string][] or [bool][] * Default: `True` * Values: `False` or any level Sets the verbosity of log statements for failures. ##### request_timeout * _Optional_ * Type: [int][] * Default: `30000` The amount of time (in ms) the request should wait for LogDNA to respond before timing out. ##### tags * _Optional_ * Type: [list][]<[string][]> * Default: `[]` List of tags used to dynamically group hosts. More information on tags is available at [How Do I Use Host Tags?](https://docs.logdna.com/docs/logdna-agent#section-how-do-i-use-host-tags-) ##### url * _Optional_ * Type: [string][] * Default: `'https://logs.logdna.com/logs/ingest'` A custom ingestion endpoint to stream log lines into. ##### custom_fields * _Optional_ * Type: [list][]<[string][]> * Default: `['args', 'name', 'pathname', 'lineno']` List of fields out of `record` object to include in the `meta` object. By default, `args`, `name`, `pathname`, and `lineno` will be included. ##### log_error_response * _Optional_ * Type: [bool][] * Default: `False` Enables logging of the API response when an HTTP error is encountered ### log(line, [options]) #### line * _Required_ * Type: [string][] * Default: `''` The log line to be sent to LogDNA. #### options ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The level passed along with this log line. ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The app passed along with this log line. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The environment passed with this log line. ##### meta * _Optional_ * Type: [dict][] * Default: `None` A standard dictonary containing additional metadata about the log line that is passed. Please ensure values are JSON serializable. **NOTE**: Values that are not JSON serializable will be removed and the respective keys will be added to the `__errors` string. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects will be stringified and will not be searchable, but will be displayed for informational purposes. If this option is turned to true then meta objects will be parsed and will be searchable up to three levels deep. Any fields deeper than three levels will be stringified and cannot be searched. *WARNING* When this option is true, your metadata objects across all types of log messages MUST have consistent types or the metadata object may not be parsed properly! ##### timestamp * _Optional_ * Type: [float][] * Default: [time.time()][] The time in seconds since the epoch to use for the log timestamp. It must be within one day or current time - if it is not, it is ignored and time.time() is used in its place. ## Development This project makes use of the [poetry][] package manager for local development. ```shell $ poetry install ``` ### Scripts **lint** Run linting rules w/o attempting to fix them ```shell $ poetry run task lint ``` **lint:fix** Run lint rules against all local python files and attempt to fix where possible. ```shell $ poetry run task lint:fix ``` **test**: Runs all unit tests and generates coverage reports ```shell poetry run task test ``` ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Muaz Siddiqui

💻 📖 ⚠️

Samir Musali

💻 📖 ⚠️

vilyapilya

💻 🚧 ⚠️

Mike Hu

📖

Eric Satterwhite

💻 📖 ⚠️ 🔧

Łukasz Bołdys (Lukasz Boldys)

💻 🐛

Ryan

📖

Mike Huang

💻 🐛

Dan Maas

💻

DChai

📖

Jakob de Maeyer

💻

Andrey Babak

💻

Mike S

💻 📖

Brennan Ashton

💻

Christian Hotz-Behofsits

💻 🐛

Kurtiss Hare

🐛

Alexey Kinev

🐛

matthiasfru

🐛
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ## License MIT © [LogDNA](https://logdna.com/) Copyright © 2017 [LogDNA][], released under an MIT license. See the [LICENSE](./LICENSE) file and [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT) *Happy Logging!* [bool]: https://docs.python.org/3/library/stdtypes.html#boolean-values [dict]: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict [int]: https://docs.python.org/3/library/functions.html#int [float]: https://docs.python.org/3/library/functions.html#float [string]: https://docs.python.org/3/library/string.html [list]: https://docs.python.org/3/library/stdtypes.html#list [time.time()]: https://docs.python.org/3/library/time.html?#time.time [poetry]: https://python-poetry.org [LogDNA]: https://logdna.com/ [LogRecord]: https://docs.python.org/2/library/logging.html#logrecord-objects [fileConfig]: https://docs.python.org/2/library/logging.config.html#logging.config.fileConfig %package help Summary: Development documents and examples for logdna Provides: python3-logdna-doc %description help * [Installation](#installation) * [Setup](#setup) * [Usage](#usage) * [Usage with fileConfig](#usage-with-fileconfig) * [API](#api) * [LogDNAHandler(key: string, [options: dict])](#logdnahandlerkey-string-options-dict) * [key](#key) * [options](#options) * [log(line, [options])](#logline-options) * [line](#line) * [options](#options-1) * [Development](#development) * [Scripts](#scripts) * [License](#license) ## Installation ```bash $ pip install logdna ``` ## Setup ```python import logging from logdna import LogDNAHandler import os # Set your key as an env variable # then import here, its best not to # hard code your key! key=os.environ['INGESTION_KEY'] log = logging.getLogger('logdna') log.setLevel(logging.INFO) options = { 'hostname': 'pytest', 'ip': '10.0.1.1', 'mac': 'C0:FF:EE:C0:FF:EE' } # Defaults to False; when True meta objects are searchable options['index_meta'] = True options['custom_fields'] = 'meta' test = LogDNAHandler(key, options) log.addHandler(test) log.warning("Warning message", extra={'app': 'bloop'}) log.info("Info message") ``` _**Required**_ * [LogDNA Ingestion Key](https://app.logdna.com/manage/profile) _**Optional**_ * Hostname - ([string][]) * MAC Address - ([string][]) * IP Address - ([string][]) * Index Meta - ([bool][]) - formatted as `options['index_meta']` ## Usage After initial setup, logging is as easy as: ```python # Simplest use case log.info('My Sample Log Line') # Add a custom level log.info('My Sample Log Line', extra={ 'level': 'MyCustomLevel' }) # Include an App name with this specific log log.info('My Sample Log Line', extra={ 'level': 'Warn', 'app': 'myAppName'}) # Pass associated objects along as metadata meta = { 'foo': 'bar', 'nested': { 'nest1': 'nested text' } } opts = { 'level': 'warn', 'meta': meta } log.info('My Sample Log Line', extra=opts) ``` ### Usage with fileConfig To use [LogDNAHandler](#logdnahandlerkey-string-options-dict) with [fileConfig][] (e.g., in a Django `settings.py` file): ```python import os import logging from logdna import LogDNAHandler # required to register `logging.handlers.LogDNAHandler` LOGGING = { # Other logging settings... 'handlers': { 'logdna': { 'level': logging.DEBUG, 'class': 'logging.handlers.LogDNAHandler', 'key': os.environ.get('LOGDNA_INGESTION_KEY'), 'options': { 'app': '', 'env': os.environ.get('ENVIRONMENT'), 'index_meta': , }, }, }, 'loggers': { '': { 'handlers': ['logdna'], 'level': logging.DEBUG }, }, } ``` (This example assumes you have set environment variables for `ENVIRONMENT` and `LOGDNA_INGESTION_KEY`.) ## API ### LogDNAHandler(key: [string][], [options: [dict][]]) #### key * _**Required**_ * Type: [string][] * Values: `` The [LogDNA API Key](https://app.logdna.com/manage/profile) associated with your account. #### options ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default app named that is included in every every log line sent through this instance. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default env passed along with every log sent through this instance. ##### hostname * _Optional_ * Type: [string][] * Default: `''` * Values: `` The default hostname passed along with every log sent through this instance. ##### include_standard_meta * _Optional_ * Type: [bool][] * Default: `False` Python [LogRecord][] objects includes language-specific information that may be useful metadata in logs. Setting `include_standard_meta` to `True` automatically populates meta objects with `name`, `pathname`, and `lineno` from the [LogRecord][]. *WARNING* This option is deprecated and will be removed in the upcoming major release. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects are stringified and not searchable, and are only displayed for informational purposes. If this option is set to True then meta objects are parsed and searchable up to three levels deep. Any fields deeper than three levels are stringified and cannot be searched. *WARNING* If this option is True, your metadata objects MUST have consistent types across all log messages or the metadata object might not be parsed properly. ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The default level passed along with every log sent through this instance. ##### verbose * _Optional_ * Type: [string][] or [bool][] * Default: `True` * Values: `False` or any level Sets the verbosity of log statements for failures. ##### request_timeout * _Optional_ * Type: [int][] * Default: `30000` The amount of time (in ms) the request should wait for LogDNA to respond before timing out. ##### tags * _Optional_ * Type: [list][]<[string][]> * Default: `[]` List of tags used to dynamically group hosts. More information on tags is available at [How Do I Use Host Tags?](https://docs.logdna.com/docs/logdna-agent#section-how-do-i-use-host-tags-) ##### url * _Optional_ * Type: [string][] * Default: `'https://logs.logdna.com/logs/ingest'` A custom ingestion endpoint to stream log lines into. ##### custom_fields * _Optional_ * Type: [list][]<[string][]> * Default: `['args', 'name', 'pathname', 'lineno']` List of fields out of `record` object to include in the `meta` object. By default, `args`, `name`, `pathname`, and `lineno` will be included. ##### log_error_response * _Optional_ * Type: [bool][] * Default: `False` Enables logging of the API response when an HTTP error is encountered ### log(line, [options]) #### line * _Required_ * Type: [string][] * Default: `''` The log line to be sent to LogDNA. #### options ##### level * _Optional_ * Type: [string][] * Default: `Info` * Values: `Debug`, `Trace`, `Info`, `Warn`, `Error`, `Fatal`, `` The level passed along with this log line. ##### app * _Optional_ * Type: [string][] * Default: `''` * Values: `` The app passed along with this log line. ##### env * _Optional_ * Type: [string][] * Default: `''` * Values: `` The environment passed with this log line. ##### meta * _Optional_ * Type: [dict][] * Default: `None` A standard dictonary containing additional metadata about the log line that is passed. Please ensure values are JSON serializable. **NOTE**: Values that are not JSON serializable will be removed and the respective keys will be added to the `__errors` string. ##### index_meta * _Optional_ * Type: [bool][] * Default: `False` We allow meta objects to be passed with each line. By default these meta objects will be stringified and will not be searchable, but will be displayed for informational purposes. If this option is turned to true then meta objects will be parsed and will be searchable up to three levels deep. Any fields deeper than three levels will be stringified and cannot be searched. *WARNING* When this option is true, your metadata objects across all types of log messages MUST have consistent types or the metadata object may not be parsed properly! ##### timestamp * _Optional_ * Type: [float][] * Default: [time.time()][] The time in seconds since the epoch to use for the log timestamp. It must be within one day or current time - if it is not, it is ignored and time.time() is used in its place. ## Development This project makes use of the [poetry][] package manager for local development. ```shell $ poetry install ``` ### Scripts **lint** Run linting rules w/o attempting to fix them ```shell $ poetry run task lint ``` **lint:fix** Run lint rules against all local python files and attempt to fix where possible. ```shell $ poetry run task lint:fix ``` **test**: Runs all unit tests and generates coverage reports ```shell poetry run task test ``` ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Muaz Siddiqui

💻 📖 ⚠️

Samir Musali

💻 📖 ⚠️

vilyapilya

💻 🚧 ⚠️

Mike Hu

📖

Eric Satterwhite

💻 📖 ⚠️ 🔧

Łukasz Bołdys (Lukasz Boldys)

💻 🐛

Ryan

📖

Mike Huang

💻 🐛

Dan Maas

💻

DChai

📖

Jakob de Maeyer

💻

Andrey Babak

💻

Mike S

💻 📖

Brennan Ashton

💻

Christian Hotz-Behofsits

💻 🐛

Kurtiss Hare

🐛

Alexey Kinev

🐛

matthiasfru

🐛
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ## License MIT © [LogDNA](https://logdna.com/) Copyright © 2017 [LogDNA][], released under an MIT license. See the [LICENSE](./LICENSE) file and [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT) *Happy Logging!* [bool]: https://docs.python.org/3/library/stdtypes.html#boolean-values [dict]: https://docs.python.org/3/library/stdtypes.html#mapping-types-dict [int]: https://docs.python.org/3/library/functions.html#int [float]: https://docs.python.org/3/library/functions.html#float [string]: https://docs.python.org/3/library/string.html [list]: https://docs.python.org/3/library/stdtypes.html#list [time.time()]: https://docs.python.org/3/library/time.html?#time.time [poetry]: https://python-poetry.org [LogDNA]: https://logdna.com/ [LogRecord]: https://docs.python.org/2/library/logging.html#logrecord-objects [fileConfig]: https://docs.python.org/2/library/logging.config.html#logging.config.fileConfig %prep %autosetup -n logdna-1.18.6 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-logdna -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon Apr 10 2023 Python_Bot - 1.18.6-1 - Package Spec generated