Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 📝
- Host: GitHub
- URL: https://github.com/metarhia/metalog
- Owner: metarhia
- License: mit
- Created: 2017-08-06T20:06:09.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-04T10:50:15.000Z (3 months ago)
- Last Synced: 2024-12-12T09:59:29.150Z (10 days ago)
- Topics: api, application-server, cloud, console, hacktoberfest, highload, impress, log, logger, logging, meta-edu, metarhia, node, nodejs, server, tools
- Language: JavaScript
- Homepage: https://metarhia.com
- Size: 775 KB
- Stars: 40
- Watchers: 16
- Forks: 17
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Authors: AUTHORS
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.