
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@edirect/logger
Advanced tools
Structured logging module for eDirect NestJS applications. Built on top of [Pino](https://github.com/pinojs/pino), providing high-performance JSON logging to stdout/stderr, configurable log levels, and correlation ID tracking (sessionId / quoteId).
Structured logging module for eDirect NestJS applications. Built on top of Pino, providing high-performance JSON logging to stdout/stderr, configurable log levels, and correlation ID tracking (sessionId / quoteId).
message, level, timestamp, name, version)sessionId and quoteId as correlation context in all log entriesLoggerService anywhereregister) and async (registerAsync) configurationpnpm add @edirect/logger
# or
npm install @edirect/logger
import { Module } from '@nestjs/common';
import { LoggerModule } from '@edirect/logger';
@Module({
imports: [
LoggerModule.register({
output: 'console',
level: 'info',
name: 'my-service',
}),
],
})
export class AppModule {}
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@edirect/config';
import { LoggerModule } from '@edirect/logger';
@Module({
imports: [
ConfigModule,
LoggerModule.registerAsync({
imports: [ConfigModule],
useFactory: (configService: ConfigService) => ({
level: (configService.get('LOGS_LEVEL') as any) ?? 'info',
name: configService.get('APP_NAME') ?? 'app',
}),
inject: [ConfigService],
}),
],
})
export class AppModule {}
import { Injectable } from '@nestjs/common';
import { LoggerService } from '@edirect/logger';
@Injectable()
export class OrderService {
constructor(private readonly logger: LoggerService) {}
async processOrder(orderId: string, sessionId: string) {
this.logger.setSessionId(sessionId);
this.logger.setQuoteId(orderId);
this.logger.info('Processing order', JSON.stringify({ orderId }));
try {
// business logic...
this.logger.log('Order processed successfully');
} catch (err) {
this.logger.error('Order processing failed', (err as Error).stack ?? '');
}
}
}
LoggerService methods| Method | Signature | Description |
|---|---|---|
log | (message: string, payload?: string): void | Alias for info |
info | (message: string, payload?: string): void | Log at INFO level |
warn | (message: string, payload?: string): void | Log at WARN level |
error | (message: string, trace: string): void | Log at ERROR level |
debug | (message: string): void | Log at DEBUG level |
verbose | (message: string): void | Log at VERBOSE level (maps to INFO internally) |
setSessionId | (sessionId: string): void | Attach a session ID to all subsequent log entries |
setQuoteId | (quoteId: string): void | Attach a quote/correlation ID to all subsequent log entries |
LoggerModuleOptions| Option | Type | Default | Description |
|---|---|---|---|
level | pino.Level | 'info' | Minimum log level |
name | string | npm_package_name | 'app' | Service name in every log entry |
version | string | npm_package_version | '0.0.0' | Service version in every log entry |
host | string | '0.0.0.0' | Host tag |
protocol | string | 'http' | Protocol tag |
When options are not passed explicitly, the logger reads from environment variables:
| Variable | Description | Default |
|---|---|---|
LOGS_LEVEL | Log level (trace, debug, info, warn, error, fatal) | info |
LOGS_HOST | Host tag in log entries | 0.0.0.0 |
LOGS_PROTOCOL | Protocol tag in log entries | http |
APP_NAME | Service name | npm_package_name or app |
APP_VERSION | Service version | npm_package_version or 0.0.0 |
Every log entry is a JSON object:
{
"level": "info",
"timestamp": "2024-01-15T10:30:00.000Z",
"name": "payment-gateway",
"version": "1.2.3",
"host": "pod-abc-123",
"protocol": "http",
"sessionId": "session-abc-123",
"quoteId": "quote-xyz-456",
"remote-address": "",
"message": "Order created successfully",
"payload": { "orderId": "ORD-789" }
}
FAQs
Structured logging module for eDirect NestJS applications. Built on top of [Pino](https://github.com/pinojs/pino), providing high-performance JSON logging with AsyncLocalStorage support for automatic context propagation, file output, and seamless integrat
We found that @edirect/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 29 open source maintainers collaborating on the project.
Did you know?

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.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.