This is an automated email from the ASF dual-hosted git repository.
zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 573f21d1a8 TP log more events in access logs (#7386)
573f21d1a8 is described below
commit 573f21d1a8673ead63f4ee0c30bb0f17b7ff9835
Author: Steve Hamrick <[email protected]>
AuthorDate: Wed Mar 8 13:56:12 2023 -0700
TP log more events in access logs (#7386)
* Log all access events and not just unknown routes
* Changelog
---
CHANGELOG.md | 1 +
traffic_portal/server.js | 15 +++++++--------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1552ce989a..7648fb7f6e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,6 +46,7 @@ The format is based on [Keep a
Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7120](https://github.com/apache/trafficcontrol/pull/7120) *Docs* Update
t3c documentation regarding parent.config parent_retry.
- [#7044](https://github.com/apache/trafficcontrol/issues/7044) *CDN in a Box*
[CDN in a Box, the t3c integration tests, and the tc health client integration
tests now use Apache Traffic Server 9.1.
- [#7366](https://github.com/apache/trafficcontrol/pull/7366) *t3c* Removed
timestamp from metadata file since it's changing every minute and causing
excessive commits to git repo.
+- [#7386](https://github.com/apache/trafficcontrol/pull/7386) *Traffic Portal*
Increased the number of events that are logged to the TP access log.
### Fixed
- [#7340](https://github.com/apache/trafficcontrol/pull/7340) *Traffic Router*
Fixed TR logging for the `cqhv` field when absent.
diff --git a/traffic_portal/server.js b/traffic_portal/server.js
index d6f12f75e7..fe45434eac 100644
--- a/traffic_portal/server.js
+++ b/traffic_portal/server.js
@@ -60,6 +60,13 @@ app.use(function(_, resp, next) {
next();
});
+let morganOpts = {
+};
+if (logStream !== null) {
+ morganOpts.stream = logStream;
+}
+app.use(morgan('combined', morganOpts));
+
app.use(function(req, res, next) {
var err = null;
try {
@@ -95,14 +102,6 @@ app.use(modRewrite([
app.use(express.static(config.files.static));
-let morganOpts = {
- skip: (_, res) => res.statusCode < 400
-};
-if (logStream !== null) {
- morganOpts.stream = logStream;
-}
-
-app.use(morgan('combined', morganOpts));
app.use(timeout(config.timeout));
if (app.get('env') === 'dev') {