You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mongodb-log-writer

Package Overview
Dependencies
Maintainers
25
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-log-writer

A library for writing MongoDB logv2 messages

2.4.1
latest
Source
npmnpm
Version published
Weekly downloads
113K
-22.71%
Maintainers
25
Weekly downloads
 
Created
Source

mongodb-log-writer

A library for writing MongoDB logv2 messages.

import { MongoLogManager, mongoLogId } from 'mongodb-log-writer';

const manager = new MongoLogManager({
  directory: os.homedir() + '/.app-logs',
  retentionDays: 30,
  onwarn: console.warn,
  onerror: console.error,
  gzip: true
});
await manager.cleanupOldLogfiles();

const writer = manager.createLogWriter();
writer.info('component', mongoLogId(12345), 'context', 'message', { foo: 'bar' });

LICENSE

Apache-2.0

Keywords

mongodb

FAQs

Package last updated on 08 Apr 2025

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