Skip to content

metarhia/metalog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b3adfd8 Β· Aug 30, 2024
Aug 30, 2024
Oct 26, 2023
Dec 16, 2020
Oct 27, 2020
Aug 6, 2017
Aug 6, 2017
Jul 13, 2023
Dec 10, 2023
Aug 30, 2024
May 4, 2021
Aug 30, 2024
Aug 30, 2024
Jan 7, 2021
Aug 27, 2024
Oct 17, 2023
Oct 17, 2023
Aug 30, 2024
Aug 30, 2024
Aug 27, 2024
Jul 22, 2021

Repository files navigation

Meta Logger for Metarhia

ci status snyk npm version npm downloads/month npm downloads license

Output example

Usage

const logger = await metalog.openLog({
  path: './log', // absolute or relative path
  workerId: 7, // mark for process or thread
  writeInterval: 3000, // flush log to disk interval
  writeBuffer: 64 * 1024, // buffer size (default 64kb)
  keepDays: 5, // delete after N days, 0 - disable
  home: process.cwd(), // remove substring from paths
  json: false, // print logs in JSON format, by default false
});

const { console } = logger;
console.log('Test message');
await logger.close();

License & Contributors

Copyright (c) 2017-2024 Metarhia contributors. Metalog is MIT licensed.
Metalog is a part of Metarhia technology stack.