Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metarhia/metalog

Metarhia logger 📝
https://github.com/metarhia/metalog

api application-server cloud console hacktoberfest highload impress log logger logging meta-edu metarhia node nodejs server tools

Last synced: 6 days ago
JSON representation

Metarhia logger 📝

Awesome Lists containing this project

README

        

# Meta Logger for Metarhia

[![ci status](https://github.com/metarhia/metalog/workflows/Testing%20CI/badge.svg)](https://github.com/metarhia/metalog/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster)
[![snyk](https://snyk.io/test/github/metarhia/impress/badge.svg)](https://snyk.io/test/github/metarhia/impress)
[![npm version](https://img.shields.io/npm/v/metalog.svg?style=flat)](https://www.npmjs.com/package/metalog)
[![npm downloads/month](https://img.shields.io/npm/dm/metalog.svg)](https://www.npmjs.com/package/metalog)
[![npm downloads](https://img.shields.io/npm/dt/metalog.svg)](https://www.npmjs.com/package/metalog)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/metarhia/metalog/blob/master/LICENSE)

## Output example

## Usage

```js
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](https://github.com/metarhia/metalog/graphs/contributors).
Metalog is [MIT licensed](./LICENSE).\
Metalog is a part of [Metarhia](https://github.com/metarhia) technology stack.