-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tpv2 logging overhaul #7673
Tpv2 logging overhaul #7673
Conversation
69a32a5
to
51e65ff
Compare
Codecov Report
@@ Coverage Diff @@
## master #7673 +/- ##
=============================================
+ Coverage 29.78% 65.60% +35.82%
Complexity 98 98
=============================================
Files 802 323 -479
Lines 85789 12829 -72960
Branches 952 965 +13
=============================================
- Hits 25550 8417 -17133
+ Misses 58099 4051 -54048
+ Partials 2140 361 -1779
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 483 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
30de8f1
to
2fd08e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E tests are failing because the SSR server is hanging up on something. When I run it locally the server says its running but it never handles requests (including proxy requests) and nothing is logged. This happens in both dev and prod mode.
2fd08e4
to
d6dba19
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed logger works and logging format makes sense, just have some minor comments.
experimental/traffic-portal/src/app/shared/import-json-txt/import-json-txt.component.ts
Outdated
Show resolved
Hide resolved
Because they're exported from utils, so the import wouldn't stutter in most cases even if you decide to import the whole module as a namespace (for whatever reason).
this simplifies it a bit and also switched to using fs/promises which is a bit faster
Also removes some try/catch blocks that appeared to be concealing test failures?
Also alphabetically sorted the declarations for the core module - we were declaring a few things multiple times.
Makes use of the utils package to avoid the need for 'as' statements
limited success on that front
…onses in some cases
Made it like 14x faster on my machine - I was a real idiot to not do that in the first place.
2e31dbc
to
4cef64e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add a logging class * re-name things to include a Log prefix Because they're exported from utils, so the import wouldn't stutter in most cases even if you decide to import the whole module as a namespace (for whatever reason). * Add middleware for logging and error handling * Move file compression stuff into middleware this simplifies it a bit and also switched to using fs/promises which is a bit faster * rework TO proxy handler to use a logger * Add a front-end logging service * fixup allowed console methods now that there's a logger * Fix linting errors arising from not using loggers * Remove console calls from tests Also removes some try/catch blocks that appeared to be concealing test failures? * fix non-camelCase component naming Also alphabetically sorted the declarations for the core module - we were declaring a few things multiple times. * Simplify type guards in server configuration Makes use of the utils package to avoid the need for 'as' statements * Add typing for a Node SystemError * Fix incorrect use of logging middleware * Try to clean up some errors being hit in the SSR handler limited success on that front * fix directory handle leak * Make non-production server builds debug-able * add initial debug log for all requests, fix double-writing error responses in some cases * Move "time elapsed" debug message so that non-error responses also log it * Remove duplicated check, extraneous substring argument * Fix missing `req` option to SSR engine handler * Update a lot of fs access to be asynchronous * Fix hard-coded VERSION file path * Cache file compressions instead of recalculating on every request Made it like 14x faster on my machine - I was a real idiot to not do that in the first place. * Fix lint errors from rebasing * Make regexp non-polynomial * Fix comment grammar
This PR overhauls the way TPv2 does logging to be more consistent. At present, it's not configurable, it just omits debug-level messages if it's in a production environment. The idea was primarily to add it to the server, which had sparse and opaque logging, but a logging service was also added to the UI to allow for a consistent logging format there. Really all that does is add timestamps to everything (so far).
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Make sure the tests pass, look at the server logs and see if the format looks good.
PR submission checklist