Commit Graph

29 Commits

Author SHA1 Message Date
Iain Sproat a1ed7dacd9 fix(logging): /metrics, /readiness, /liveness logged as debug (#3156) 2024-10-10 10:24:07 +01:00
Iain Sproat f31b35df53 feat(logging): log request query params, redacting sensitive data (#3164) 2024-10-10 11:14:59 +02:00
Iain Sproat 0c9aba691e fix(server): properly log thrown errors (#3072) 2024-09-25 11:10:43 +02:00
Iain Sproat cd14619790 fix(logging): use getRequestPath to more robustly identify debug logs (#3005) 2024-09-16 14:01:34 +01:00
Iain Sproat 3f373f1cb7 feat(logging): record when request is received by express (#2737) 2024-08-26 16:42:06 +01:00
Alessandro Magionami 447b48a6c2 chore(server): remove relative imports 2024-07-18 16:07:16 +02:00
Iain Sproat 1d2bc481c8 feat(logging): metrics endpoint is logged as debug level, not info (#2490) 2024-07-10 13:25:52 +01:00
Iain Sproat c23557050d Healthchecks should only be debug level of log (#2440) 2024-06-26 11:26:44 +01:00
Kristaps Fabians Geikins edb1c63d21 feat: fe2 status check endpoint w/ proper redis cleanup (#2092) 2024-02-28 15:02:52 +02:00
Iain Sproat df3c138786 Revert "feat(fe2): proper health probe endpoint - /api/status - [WBX-287] (#2…" (#2091)
This reverts commit 585fa873cb.
2024-02-28 11:38:08 +00:00
Kristaps Fabians Geikins 585fa873cb feat(fe2): proper health probe endpoint - /api/status - [WBX-287] (#2086)
* feat: proper health probe endpoint - /api/status

* preventing external access to status endpoint

* linting fix
2024-02-27 16:34:33 +02:00
Kristaps Fabians Geikins 48440e5b7c fix(server): rate limiter path resolution (#2042) 2024-02-13 15:08:48 +02:00
Iain Sproat 2983183fe0 fix(server/logging): sensitive response headers should not be logged (#2039) 2024-02-12 18:29:46 +00:00
Kristaps Fabians Geikins d836b645e4 fix(server): more accurate requestPath 2024-02-12 18:45:01 +02:00
Kristaps Fabians Geikins d3ad2eac2e fix(server): log redirect reqs as well 2024-02-12 18:25:02 +02:00
Kristaps Fabians Geikins 0a63afb6aa feat: various observability improvements (#2027)
* feat(server): adding userId to req logs

* feat(server): adding userId to gql logs

* feat(fe2): adding userId to logger calls

* feat(fe2): more userId logging additions

* even more thorough logging in FE2

* more adjustments

* add country to fe2 logs

* added prop to help distinguish gql req time logs

* get initial SSR req id in CSR logs

* improved 'fetch failed' error

* better rate limit error message

* minor improvements
2024-02-09 13:56:13 +02:00
Gergő Jedlicska ee849006ad fix: request logs (#1964)
* fix: request logs

* chore: remove comments
2024-01-11 16:17:04 +01:00
Kristaps Fabians Geikins 4144ce0d8e feat(fe2): improved and more thorough logging to help with observability (#1948)
* better req log text

* minor improvements to server logging

* WIP FE2 req logging

* FE2 apollo operation logging

* undid apolloPlugin changes due to Gergos PR

* seq message templates introduced
2024-01-11 12:15:45 +02:00
Iain Sproat 2d0d4b3d9a fix(ip logging): handle ip addresses in header x-original-forwarded-for (#1686) 2023-07-11 23:00:42 +01:00
Iain Sproat 8bc04f97d9 fix(logging): hash ip for all requests with an ip (#1531) 2023-04-13 17:38:17 +01:00
Iain Sproat 6f718d8d91 fix(logging): should log headers in request; add missing return statement (#1529) 2023-04-13 15:30:34 +01:00
Iain Sproat 122f4c731f feat(log): log the ip address if a user is not logged in (#1527)
- we do not log both the ip if the user is signed in, as this may be a privacy issue
- the ip is only logged if there is no associated user information
2023-04-13 14:57:07 +01:00
Iain Sproat d61138e157 feat(log): logs all headers, except authorization and cookie (#1517)
* feat(log): logs all headers, except authorization and cookie
* fix(logging): print headers for raw response
2023-04-11 20:11:56 +01:00
Iain Sproat 7e89950358 feat(logging): log all http requests and responses (#1416)
- feat(logging): log all http requests and responses
- the auto logger does not log the body, to ensure sensitive payloads are not logged. Unfortunately this means that error messages are not logged either, so need to be manually logged.
- fix(logging): 400 errors should be info not error severity logging
2023-02-27 15:14:56 +00:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00