Feathers.js Request Id Middleware

This page summarizes the projects mentioned and recommended in the original post on dev.to
Log

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • winston

    A logger for just about everything.

  • // A hook that logs service method before, after and error // See https://github.com/winstonjs/winston for documentation // about the logger. import logger from '../logger'; import util from 'util'; import { HookContext, Hook } from '@feathersjs/feathers'; // To see more detailed messages, uncomment the following line: logger.level = 'debug'; export default function (): Hook { return (context: HookContext) => { const { params } = context; const requestId = params.requestId; logger.debug(`Request Id: ${requestId}`); // This debugs the service call and a stringified version of the hook context // You can customize the message (and logger) to your needs logger.debug( `${context.type} app.service('${context.path}').${context.method}()`, ); if ( // eslint-disable-next-line @typescript-eslint/no-explicit-any typeof (context as any).toJSON === 'function' && logger.level === 'debug' ) { logger.debug('Hook Context', util.inspect(context, { colors: false })); } if (context.error && !context.result) { logger.error(context.error.stack); } }; }

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts