Skip to content

Log operation performed on the request

Omar Qunsul requested to merge 18-integrate-logger-into-http-router into main

Addressing: #18 (closed)

What has been done in this MR?

  1. Adding Logger class with different levels of logging. Passing the object around between functions, to log events. At the moment we are only logging info events, that are aggregated at CloudFlare at the request level.
  2. Adding config for the logging level to the ENV variables.

How do the logs show up on CloudFlare?

CloudFlare aggregates all the output per request, and shows them in this section, which is empty now logs: []

Screenshot_2024-09-10_at_10.22.02

Steps to validate

Validate in Passthrough mode

  1. Checkout this branch on GDK / gitlab-http-router
  2. Run gdk reconfigure to make sure to generate the wrangler.toml file.
  3. Make sure in wrangler.toml dev environment, and it's running in passthrough mode for GITLAB_RULES_CONFIG
  4. Make requests to gdk.test:3000 in the browser, and watch the logs in gdk tail gitlab-http-router. You should see items like { rule_applied: '0_proxy', rule_action: 'proxy' } and { proxy_host: 'gdk.test:3333' }.

Validate in Classify Mode

  1. Checkout this branch on GDK / gitlab-http-router
  2. TODO: I will provide the rest of the steps soon.
  3. Change your wrangler.toml file in dev environment to use firstcell instead of passthrough for GITLAB_RULES_CONFIG.
  4. In gdk tail gitlab-http-router you should see items containing { cache: 'miss', cache_fetch_ms: 0 } and { source: .... }
Edited by Omar Qunsul

Merge request reports

Loading