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

Bring-your-own logger #640

Merged
merged 32 commits into from
Feb 26, 2024
Merged

Bring-your-own logger #640

merged 32 commits into from
Feb 26, 2024

Conversation

jpage-godaddy
Copy link
Contributor

@jpage-godaddy jpage-godaddy commented Dec 14, 2023

Summary

Gasket's logging infrastructure comprises two main parts:

  1. @gasket/plugin-log: Manages lifecycle timing and executes the logTransports hook for adding extra transports to the logger configuration.
  2. @gasket/log: Implements logging using Diagnostics (Client-side) and Winston (Server-side).

While these components work together to initialize gasket.logger, not all applications utilize them. Additionally, despite Winston's prevalence, we need to be aware of the numerous logging libraries in the ecosystem when adopting Gasket.

Updates

  • Create a new @gasket/plugin-logger to replace @gasket/plugin-log
  • Create @gasket/plugin-winston to customize the default logger
  • Include the new logger plugin by default
  • Add a per-request logger with updateable metadata
  • Update the default redux logger to use the per-request logger
  • Update presets to use the winston logger

Changelog

Test Plan

Added/updated unit tests.

- Create a new `@gasket/plugin-logger` to replace `@gasket/plugin-log`
- Create `@gasket/plugin-winston` to customize the default logger
- Include the new logger plugin by default
- Add a per-request logger with updateable metadata
- Update the default redux logger to use the per-request logger
- Update presets to use the winston logger
@jpage-godaddy jpage-godaddy marked this pull request as draft December 14, 2023 00:50
Copy link

github-actions bot commented Dec 14, 2023

package-lock.json changes

Summary

Status Count
ADDED 2
UPDATED 42
DOWNGRADED 5
REMOVED 4
Click to toggle table visibility
Name Status Previous Current
@babel/cli UPDATED 7.23.4 7.23.9
@babel/core UPDATED 7.23.7 7.23.9
@babel/eslint-parser UPDATED 7.23.3 7.23.10
@babel/helper-create-class-features-plugin UPDATED 7.23.7 7.23.10
@babel/helper-define-polyfill-provider UPDATED 0.4.4 0.5.0
@babel/helpers UPDATED 7.23.8 7.23.9
@babel/node UPDATED 7.22.19 7.23.9
@babel/parser UPDATED 7.23.6 7.23.9
@babel/plugin-transform-async-generator-functions UPDATED 7.23.7 7.23.9
@babel/plugin-transform-modules-systemjs UPDATED 7.23.3 7.23.9
@babel/plugin-transform-runtime UPDATED 7.23.7 7.23.9
@babel/preset-env UPDATED 7.23.8 7.23.9
@babel/runtime UPDATED 7.23.8 7.23.9
@babel/template UPDATED 7.22.15 7.23.9
@babel/traverse UPDATED 7.23.7 7.23.9
@babel/types UPDATED 7.23.6 7.23.9
@gasket/plugin-logger ADDED - file:packages/gasket-plugin-logger
@gasket/plugin-winston ADDED - file:packages/gasket-plugin-winston
@humanwhocodes/config-array DOWNGRADED 0.11.14 0.11.13
@humanwhocodes/object-schema DOWNGRADED 2.0.2 2.0.1
@jridgewell/source-map UPDATED 0.3.2 0.3.5
@jridgewell/trace-mapping UPDATED 0.3.18 0.3.22
@sideway/address UPDATED 4.1.4 4.1.5
@types/babel__generator DOWNGRADED 7.6.8 7.6.7
@types/babel__traverse DOWNGRADED 7.20.5 7.20.4
@types/estree UPDATED 1.0.1 1.0.5
@types/jest UPDATED 29.5.11 29.5.12
@types/webpack-bundle-analyzer UPDATED 4.6.3 4.7.0
axios UPDATED 1.6.2 1.6.7
babel-plugin-polyfill-corejs2 UPDATED 0.4.7 0.4.8
babel-plugin-polyfill-corejs3 UPDATED 0.8.7 0.9.0
babel-plugin-polyfill-regenerator UPDATED 0.5.4 0.5.5
browserslist UPDATED 4.22.2 4.22.3
caniuse-lite UPDATED 1.0.30001577 1.0.30001585
core-js-compat UPDATED 3.35.0 3.35.1
core-js UPDATED 3.35.0 3.35.1
cypress UPDATED 13.6.3 13.6.4
electron-to-chromium UPDATED 1.4.632 1.4.665
follow-redirects UPDATED 1.15.0 1.15.5
is-builtin-module UPDATED 3.2.0 3.2.1
jest-config REMOVED 29.7.0 -
joi UPDATED 17.11.0 17.12.1
jsdoc-parse UPDATED 6.1.0 6.2.1
lodash.pick REMOVED 4.4.0 -
lodash.set REMOVED 4.3.2 -
mocha UPDATED 10.2.0 10.3.0
nanoid REMOVED 3.3.3 -
nock UPDATED 13.2.4 13.5.1
qs DOWNGRADED 6.11.0 6.10.4
regexp-tree UPDATED 0.1.24 0.1.27
terser-webpack-plugin UPDATED 5.3.9 5.3.10
terser UPDATED 5.17.6 5.27.0
webpack UPDATED 5.89.0 5.90.1

Copy link
Contributor

@agerard-godaddy agerard-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some initial comments/questions - Obviously this is going to have some breaking changes so we will need to incorporate into our next major release.

packages/gasket-plugin-express/lib/index.js Outdated Show resolved Hide resolved
packages/gasket-plugin-express/lib/index.js Outdated Show resolved Hide resolved
packages/gasket-plugin-express/lib/index.js Outdated Show resolved Hide resolved
packages/gasket-plugin-logger/README.md Outdated Show resolved Hide resolved
packages/gasket-plugin-logger/src/index.ts Outdated Show resolved Hide resolved
packages/gasket-plugin-winston/src/index.ts Outdated Show resolved Hide resolved
@agerard-godaddy agerard-godaddy added the version 7 Change targeted for version 7 label Dec 14, 2023
@kbader-godaddy kbader-godaddy changed the base branch from main to v7 February 5, 2024 16:33
@kbader-godaddy kbader-godaddy requested review from a team February 12, 2024 16:23
@kbader-godaddy kbader-godaddy marked this pull request as ready for review February 12, 2024 18:40
packages/gasket-plugin-logger/lib/index.js Outdated Show resolved Hide resolved
packages/gasket-plugin-logger/README.md Outdated Show resolved Hide resolved
packages/gasket-plugin-intl/lib/build-manifest.js Outdated Show resolved Hide resolved
packages/gasket-plugin-intl/lib/build-manifest.js Outdated Show resolved Hide resolved
packages/gasket-plugin-winston/README.md Outdated Show resolved Hide resolved
kbader-godaddy and others added 2 commits February 12, 2024 15:25
Co-authored-by: Andrew Gerard <63810935+agerard-godaddy@users.noreply.github.com>
@mmason2-godaddy
Copy link
Contributor

I'm excited for this change. Didn't see anything glaring but I would like to confirm - we will no longer need gasket/log correct?

kbader-godaddy and others added 2 commits February 23, 2024 09:53
Co-authored-by: Michael Mason <105235096+mmason2-godaddy@users.noreply.github.com>
@kbader-godaddy
Copy link
Contributor

I'm excited for this change. Didn't see anything glaring but I would like to confirm - we will no longer need gasket/log correct?

That is correct.

Co-authored-by: Michael Mason <105235096+mmason2-godaddy@users.noreply.github.com>
CODEOWNERS Outdated Show resolved Hide resolved
packages/gasket-plugin-morgan/README.md Outdated Show resolved Hide resolved
@kbader-godaddy kbader-godaddy merged commit 7e888c4 into v7 Feb 26, 2024
3 of 4 checks passed
@kbader-godaddy kbader-godaddy deleted the byo-logger branch February 26, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
version 7 Change targeted for version 7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants