From a2a723787c3a0c84a1c708fd0b850d08d2a18c9d Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Fri, 7 Jan 2022 22:14:23 -0800 Subject: [PATCH] Add note about log stream naming --- README.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2a9599b..6e9bfaa 100644 --- a/README.rst +++ b/README.rst @@ -33,7 +33,7 @@ Install `awscli `_ and set your AWS credent logger.info(dict(foo="bar", details={})) After running the example, you can see the log output in your `AWS console -`_. +`_ under the **watchtower** log group. IAM permissions ~~~~~~~~~~~~~~~ @@ -242,6 +242,15 @@ Finally, the following shows how to load the configuration into the working appl logging.config.dictConfig(config_dict) app.run() +Log stream naming +~~~~~~~~~~~~~~~~~ +For high volume logging applications that utilize process pools, it is recommended that you keep the default log stream +name (``{machine_name}/{program_name}/{logger_name}/{process_id}``) or make it unique per process using the +``{process_id}`` template string. Because logs must be submitted sequentially to each log stream, independent processes +sending logs to the same log stream will encounter sequence token synchronization errors and spend extra resources +automatically recovering from them. As the number of processes increases, this overhead will grow until logs fail to +deliver and get dropped (causing a warning on stderr). Partitioning logs into streams by source avoids this contention. + Boto3/botocore/urllib3 logs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Because watchtower uses boto3 to send logs, the act of sending them generates a number of DEBUG level log messages