Skip to content
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

feat: create new service for logging metadata from filter #1450

Merged
merged 5 commits into from
Jun 15, 2023

Commits on Jun 15, 2023

  1. feat: create new service for logging metadata from filter

    The new `OgmaFilterLogger` an be injected into a service and take in an
    exception and an arguments host object from Nest and print out metadata
    according to how the request failed. This will **only** happen, however, if the
    request has not been logged by an interceptor, meaning there will not be double
    logging of requests which would make logs noiser.
    
    This is done by checking for the existence of the `requestId` added by the
    interceptor earlier in the call, and the major gain here is that now errors
    caused by guards or middleware can be caught can logged just as other requests
    are properly automatically logged as well, making Ogma now fully capable of
    logging **any** request type into Nest! This feature is opt-in, just as the
    interceptor is, but the power it brings is major due to now not leaving any
    requests unlogged.
    
    The only downside at the moment is not being able to determing the time length
    of the request as most underlying transports don't grab the metadata of the
    start time, but there will be mentions of how users can implement such a
    feature to allow for that if they so choose.
    jmcdo29 committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    66d6e86 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    feb3641 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    96644c9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    54f2517 View commit details
    Browse the repository at this point in the history
  5. chore: update lockfile

    jmcdo29 committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    116bd02 View commit details
    Browse the repository at this point in the history