# json-logger
## Installation
```
pip3 install mapcoloniesjsonlogger
```
## Usage Example
```py
from MapColoniesJSONLogger.logger import generate_logger
import os
log = generate_logger('service_name', log_level='INFO', handlers=[{'type': 'rotating_file', 'path': '/var/log/service.log'}])
log.info('basic message')
log.info('message with extra fields', extra={'extra.field': 'extra_value', 'service': 'some_service'}) # supports nesting of fields
log.debug('will not be in a file')
```
## Configuration Example
The configuration dict bellow is used by the package. For more information on logging configuration see [logging.config](https://docs.python.org/3.6/library/logging.config.html#module-logging.config) docs
Raw data
{
"_id": null,
"home_page": "https://github.com/MapColonies/json-logger",
"name": "MapColoniesJSONLogger",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "MapColonies",
"author_email": "mapcolonies@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ee/ed/7c6206fb9f487b8639b5a89a06cd5aa31133ef4ce70b8618d7828ba1e3ea/MapColoniesJSONLogger-1.0.0.tar.gz",
"platform": "",
"description": "# json-logger\n\n## Installation\n```\npip3 install mapcoloniesjsonlogger\n```\n\n## Usage Example\n```py\nfrom MapColoniesJSONLogger.logger import generate_logger\nimport os\n\nlog = generate_logger('service_name', log_level='INFO', handlers=[{'type': 'rotating_file', 'path': '/var/log/service.log'}])\nlog.info('basic message')\nlog.info('message with extra fields', extra={'extra.field': 'extra_value', 'service': 'some_service'}) # supports nesting of fields\nlog.debug('will not be in a file')\n```\n\n## Configuration Example\nThe configuration dict bellow is used by the package. For more information on logging configuration see [logging.config](https://docs.python.org/3.6/library/logging.config.html#module-logging.config) docs\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A JSON logger for map colonies project",
"version": "1.0.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "213f9f47ffbbc05e703bfb29e85ba877",
"sha256": "f63d7f26a4c002dd57333e8d38957532c6cebe5b68876bd7e2625108be198008"
},
"downloads": -1,
"filename": "MapColoniesJSONLogger-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "213f9f47ffbbc05e703bfb29e85ba877",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 2912,
"upload_time": "2020-11-26T16:09:12",
"upload_time_iso_8601": "2020-11-26T16:09:12.187400Z",
"url": "https://files.pythonhosted.org/packages/52/5e/3b31c34dc0163a832af84ac9ff8a20f036df8d5bb6ac1842bac8221a6dbb/MapColoniesJSONLogger-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "8786999b1d44727d6d0d10ac374e34fe",
"sha256": "a0adc1ccf87cd895fae209ac5c35ea7903a758997687381d1e1abc25986b4e29"
},
"downloads": -1,
"filename": "MapColoniesJSONLogger-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8786999b1d44727d6d0d10ac374e34fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 2310,
"upload_time": "2020-11-26T16:09:14",
"upload_time_iso_8601": "2020-11-26T16:09:14.076574Z",
"url": "https://files.pythonhosted.org/packages/ee/ed/7c6206fb9f487b8639b5a89a06cd5aa31133ef4ce70b8618d7828ba1e3ea/MapColoniesJSONLogger-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-11-26 16:09:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": null,
"github_project": "MapColonies",
"error": "Could not fetch GitHub repository",
"lcname": "mapcoloniesjsonlogger"
}