New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tc-libs/http-log

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tc-libs/http-log

Logging HTTP middleware/interceptor oriented.

latest
npmnpm
Version
3.9.0
Version published
Maintainers
1
Created
Source

@tc-libs/http-log

Logging HTTP middleware/interceptor oriented.

Il package copre due cose:

  • middleware automatici che loggano richieste/risposte
  • LoggerService per salvare log HTTP strutturati su repository

Registrazione

HttpLogModule.register(
  {
    http: {
      logReqParams: true,
      logReqBody: true,
      logResBody: false,
      logHeaders: false,
      writeIntoFile: true,
      writeIntoConsole: true,
      maxFiles: 14,
      maxSize: '10M',
    },
  },
  true,
);

Middleware

Il modulo applica globalmente:

  • HttpLogResponseMiddleware
  • HttpLogMiddleware
  • HttpLogWriteIntoConsoleMiddleware
  • HttpLogWriteIntoFileMiddleware

Quindi basta importarlo per iniziare a raccogliere log HTTP.

Decorator Logger

Per log applicativi o endpoint-specific puoi usare:

@Logger('USER_CREATE')
@Post()
create() {}

Il decorator aggancia LoggerInterceptor e salva metadata sull'azione.

LoggerService

Metodi principali:

  • info(dto)
  • debug(dto)
  • warn(dto)
  • fatal(dto)
  • raw(dto)

Esempio:

await this.loggerService.info({
  action: 'USER_LOGIN',
  description: 'Login success',
  requestId,
  method: 'POST',
  path: '/auth/login',
  statusCode: 200,
});

Sviluppo

nx build http-log
nx test http-log

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts