IEEE-NITK / corpus

A Django-based web application for managing all things IEEE NITK!
https://ieee.nitk.ac.in
2 stars 7 forks source link

Added logging to both backend and frontend #15

Closed anirudhprabhakaran3 closed 1 year ago

anirudhprabhakaran3 commented 1 year ago

Description

Adds logging of all requests to NGINX, frontend and backend.

Dependencies

For frontend, the package winston is used for logging requests.

Type of Change

What types of changes does your code introduce? Put an x in the boxes that apply

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration. (for bug fix / breaking change) Put an x in the boxes that apply


Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

nishant-nayak commented 1 year ago

Logs on the backend look proper, logs on the frontend are a bit weird.

I think SvelteKit does some optimizations wherein if a page is loaded once and you nav away from it and nav back (without browser reload), it doesn't log any subsequent attempts to load the older pages (probably because it has rendered the page once already and just has to alter something locally).

This seems to be the case for both Winston and nginx. To replicate:

  1. Load the Home page. Logs are generated for this event.
  2. Navigate to the Design System Page from the navbar. Logs are also generated for this event.
  3. Navigate back to the Home page from the navbar. Not sure about this one, sometimes the logs were generated for this event too.
  4. Navigate to the Design System Page again from the navbar. Logs don't generate for this event.

Try this out and see if you're facing the same error? If that is the case, we'll have to further explore how to accurately gather logs from the frontend.

anirudhprabhakaran3 commented 1 year ago

Closing this specific issue since no longer supported, but will note these points when we add logging.