comparison doc/upgrading.txt @ 8446:14c7c07b32d8

feature: add thread local trace_id and trace_reason to logging. Added trace_id to default logging so that all logs for a given request share the same trace_id. This allows correlation of logs across a request. admin_guide.txt, upgrading.txt: add docs update sample configs to include trace_id. rewrite logging docs in admin_guide. Hopefully they are clearer now. clean up some stuff in the logging config file docs. admin.py: add decorators to run_command to enable trace_id. change calls to db.commit() to use run_command to get trace_id. configuration.py: clean up imports. update docstrings, comments and inline docs. add trace_id to default log format. add function for testing decorated with trace_id. add support for dumping stack trace in logging. add check for pytest in sys.modules to enable log propagation when pytest is running. Otherwise tests fail as the caplog logger doesn't see the roundup logs. logcontext.py: new file to handle thread local contextvar mangement. mailgw.py: add decorators for trace_id etc. scripts/roundup_xlmrpc_server.py: add decorators for trace_id etc. fix encoding bug turning bytes into a string. fix command line issue where we can't set encoding. (not sure if changing encoding via command line even works) cgi/client.py decorate two entry points for trace_id etc. cgi/wsgi_handler.py: decorate entry point for trace_id etc. test/test_config.py: add test for trace_id in new log format. test various cases for sinfo and errors in formating msg.
author John Rouillard <rouilj@ieee.org>
date Tue, 16 Sep 2025 22:53:00 -0400
parents 7f7749d86da8
children db435e272f26
comparison
equal deleted inserted replaced
8445:4b6e9a0e13ee 8446:14c7c07b32d8
105 105
106 .. index:: Upgrading; 2.5.0 to 2.6.0 106 .. index:: Upgrading; 2.5.0 to 2.6.0
107 107
108 Migrating from 2.5.0 to 2.6.0 108 Migrating from 2.5.0 to 2.6.0
109 ============================= 109 =============================
110
111 Default Logs Include Unique Request Identifier (info)
112 -----------------------------------------------------
113
114 The default logging format has been changed from::
115
116 %(asctime)s %(levelname)s %(message)s
117
118 to::
119
120 %(asctime)s %(trace_id)s %(levelname)s %(message)s
121
122 So logs now look like::
123
124 2025-08-20 03:25:00,308 f6RPbT2s70vvJ2jFb9BQNF DEBUG get user1 cached
125
126 which in the previous format would look like::
127
128 2025-08-20 03:25:00,308 DEBUG get user1 cached
129
130 The new format includes ``trace_id`` which is a thread and process
131 unique identifier for a single request. So you can link together all
132 of the log lines and determine where a slow down or other
133 problem occurred.
134
135 The logging format is now a ``config.ini`` parameter in the
136 ``logging`` section with the name ``format``. You can change it if you
137 would like the old logging format without having to create a logging
138 configuration file. See :ref:`rounduplogging` for details.
110 139
111 Support authorized changes in your tracker (optional) 140 Support authorized changes in your tracker (optional)
112 ----------------------------------------------------- 141 -----------------------------------------------------
113 142
114 An auditor can require change verification with user's password. 143 An auditor can require change verification with user's password.

Roundup Issue Tracker: http://roundup-tracker.org/