-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration Constants and Environment Variables
Renato Byrro edited this page Feb 16, 2021
·
1 revision
As already explained in our documentation, Async HTTP Logging works based on the Python LogStash library.
To set custom constant values, please override the Python LogStash ones:
from http_logging import AsyncHttpHandler
from logstash_async import constants
constants.QUEUED_EVENTS_FLUSH_INTERVAL = 5.0
Make sure to override the constants after you import the http_logging
Classes (e.g. AsyncHttpHandler
), as demonstrated above. Otherwise, http_logging
defaults might override the values you set.
For a reference of all constant values available, please refer to Options for the asynchronous processing and formatting ⧉ in the Python LogStash documentation.
Optionally, Async HTTP Logging allows you to configure some of these parameters as environment variables.
Here is a complete list:
-
ASYNC_LOG_HTTP_PORT
: defaults to80
(converted toint
) -
ASYNC_LOG_HTTPS_PORT
: defaults to443
(converted toint
) -
ASYNC_LOG_DATABASE_PATH
: defaults to'logging-cache.db'
-
ASYNC_LOG_TIMEOUT
: defaults to5.0
(converted tofloat
) -
ASYNC_LOG_ENCODING
: defaults tosys.getfilesystemencoding()
⧉ -
ASYNC_LOG_QUEUE_CHECK_INTERVAL
: defaults to1.0
(converted tofloat
) -
QUEUED_EVENTS_FLUSH_INTERVAL
: defaults to5.0
(converted tofloat
) -
ASYNC_LOG_QUEUED_EVENTS_FLUSH_COUNT
: defaults to10
(converted toint
) -
ASYNC_LOG_QUEUED_EVENTS_BATCH_SIZE
: defaults to10
(converted toint
) -
ASYNC_LOG_DATABASE_TIMEOUT
: defaults to2.5
(converted tofloat
)