At the moment the request and response counters, as well as the log entries for requests and responses are spread between the various handler files in the beater directory.
I suggest to move the logic to a central place and wrap all requests with it. We already have a logHandler wrapped around requests. This log handler should be adapted so that it also has access to errors. See if recordingResponseWriter can be adapted and used for this.
For the counters we should add something similar, by adding a dedicated counterHandler that ensures all the counters are set properly and removes the clutter from the beater package.
While on it, we could add system tests to check that logs actually contain expected log messages, as the testing for logs is rather sparse.
Update:
This issue has been split into 2 issues. Everything concerning improvements of the log handling has been moved to #2201.
At the moment the request and response counters, as well as the log entries for requests and responses are spread between the various
handlerfiles in thebeaterdirectory.I suggest to move the logic to a central place and wrap all requests with it. We already have a
logHandlerwrapped around requests.This log handler should be adapted so that it also has access to errors. See if recordingResponseWriter can be adapted and used for this.For the counters we should add something similar, by adding a dedicated
counterHandlerthat ensures all the counters are set properly and removes the clutter from the beater package.While on it, we could add system tests to check that logs actually contain expected log messages, as the testing for logs is rather sparse.Update:
This issue has been split into 2 issues. Everything concerning improvements of the log handling has been moved to #2201.