Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
This repository was archived by the owner on Sep 25, 2025. It is now read-only.

Add logging library #412

Closed
Closed

Description

@Ryuno-Ki

This came up during review of #411.
It is somewhat related to #23.

For debugging purposes, it is helpful to have logging statements (or using breakpoints).
However, those shouldn't be shipped to production.
Thus, a logging library should be configurable via environment variable to only output values above a certain level.

Since right now, this repo ships client and server code, the chosen logging library must support both environments.
It might be helpful to pick a library, which allows to send logs to a dedicated endpoint (logging server). This way, it might help to monitor the service.

Personally, I tend to use loglevel for it.
Other popular libraries are winston, bunyan or pino.

I haven't looked into React wrapper for those, yet.

Activity

  1. timmyichen commented on Oct 12, 2020

    @timmyichen
    Contributor

    I'm not sure I see the purpose if it's just for debugging, and even then, it's much too noisy to be useful for debugging a particular problem.

    The only useful thing I can see from using a logger here would be for http requests.

  2. Ryuno-Ki commented on Oct 12, 2020

    @Ryuno-Ki
    ContributorAuthor

    You can log warnings and errors for example.
    Say, a AJAX request did not succeed.
    Or an unhandled error is thrown.
    Those are worth logging.

  3. timmyichen commented on Oct 12, 2020

    @timmyichen
    Contributor

    We shouldn't have any real need for frontend ajax request logging if we are using Apollo (the network tab also does this)

    Unhandled exceptions are already logged to the console in every environment.

    Just speaking from personal experience, I would turn this off 100% of the time because it's just either noise or it's inferior to existing debugging tools.

  4. Ryuno-Ki commented on Oct 12, 2020

    @Ryuno-Ki
    ContributorAuthor

    Fair enough :-)

  5. timmyichen commented on Oct 12, 2020

    @timmyichen
    Contributor

    That being said, I'm curious what other peoples' thoughts are here - I may be in the minority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions