Browse Source

Merge pull request #1 from logzio/DEV-2064-add-listener-address

added the listener url to the documentation
opensearch
Roi Rav-Hon 8 years ago
committed by GitHub
parent
commit
38a8dcc9e8
3 changed files with 6 additions and 3 deletions
  1. +3
    -0
      README.md
  2. +2
    -2
      logzio/handler.py
  3. +1
    -1
      setup.py

+ 3
- 0
README.md View File

@ -39,6 +39,7 @@ format={ "loggerName":"%(name)s", "functionName":"%(funcName)s", "lineNo":"%(lin
- Number of logs to keep in buffer before draining
- Time to wait before draining, regardless of the previouse setting
- Log type, for searching in logz.io (defaults to "python")
- Logz.io Listener address (defaults to "https://listener.logz.io:8071")
#### Code Example
```python
@ -82,6 +83,7 @@ LOGGING = {
'level': 'INFO',
'formatter': 'json',
'token': 'token',
'url': 'https://listener.logz.io:8071'
'logs_drain_count': 10,
'logs_drain_timeout': 5,
'logzio_type': "django"
@ -102,6 +104,7 @@ LOGGING = {
```
*Change*
- token - Your logzio token
- url - Logz.io Listener address
- logs_drain_count - Number of logs to keep in buffer before draining
- logs_drain_timeout - Time to wait before draining, regardless of the previouse setting
- logzio_type - Log type, for searching in logz.io (defaults to "python")


+ 2
- 2
logzio/handler.py View File

@ -24,7 +24,7 @@ class LogzioHandler(logging.Handler):
drain_lock = Lock()
def __init__(self, token, logs_drain_count=100, logs_drain_timeout=10,
logzio_type="python", url="https://listener.logz.io:8071/"):
logzio_type="python", url="https://listener.logz.io:8071"):
if token is "":
raise Exception("Logz.io Token must be provided")
@ -33,7 +33,7 @@ class LogzioHandler(logging.Handler):
self.logs_drain_count = logs_drain_count
self.logs_drain_timeout = logs_drain_timeout
self.logzio_type = logzio_type
self.url = "{0}?token={1}".format(url, token)
self.url = "{0}/?token={1}".format(url, token)
self.is_main_thread_active = lambda: any((i.name == "MainThread") and i.is_alive() for i in enumerate())


+ 1
- 1
setup.py View File

@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name="logzio-python-handler",
version='1.0.2',
version='1.0.3',
description="Logging handler to send logs to your Logz.io account with bulk SSL",
keywords="logging handler logz.io bulk https",
author="roiravhon",


Loading…
Cancel
Save