🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

mongodb-log-writer

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
Version published
Weekly downloads
74K
-48.71%
Maintainers
25
Weekly downloads
 
Created

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

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