Package Exports
- meercat
- meercat/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (meercat) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MeerCat - NestJS Request Logging Middleware

The name comes from the animal, Meerkat, which is always extremely focused on its environment in order to protect its colony, and CAT, the UNIX utility which outputs text.
This is a NestJS middleware that serves a simple yet missing functionality in NestJS : logging HTTP requests and errors, like Morgan with Express. It offers several features like customization and detailed error logging
Install and Usage
npm i meercat
Then, in your main app.module.ts
import { MeercatLoggingMiddleware } from 'meercat';
// Declare the middleware on all routes
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(MeercatLoggingMiddleware).forRoutes('*');
}
}Options
Custom Logger
By default, Meercat uses the default NestJS logger, only handling the timestamp a bit differently.
You can override this behaviour by providing the token MEERCAT_LOGGER with the desired logger.
MeercatOptions
You can customize the logger behaviour by providing the token MEERCAT_OPTIONS with a MeercatOptions object :
export type MeercatOptions = {
name?: string;
logErrorDetails?: boolean; // default true
blacklisted?: string[]
};
name : Customize the logger name
logErrorDetails : logs the query, body and user agent to the console when the request status >= 400. log level: debug
blacklisted : a list of keywords, if the keyword is included in the req.baseUrl, the request won't be logged (can be used to prevent clutter)
Example :
providers: [
{
provide: MEERCAT_OPTIONS,
useValue: { logErrorDetails: false } as MeercatOptions,
},
],