https://github.com/wiselibs/super-server-logs
Read and write server logs.
https://github.com/wiselibs/super-server-logs
Last synced: 6 months ago
JSON representation
Read and write server logs.
- Host: GitHub
- URL: https://github.com/wiselibs/super-server-logs
- Owner: WiseLibs
- License: mit
- Created: 2023-10-24T10:14:09.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T02:35:50.000Z (over 1 year ago)
- Last Synced: 2025-06-22T12:08:04.783Z (7 months ago)
- Language: JavaScript
- Size: 214 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# super-server-logs [](https://github.com/WiseLibs/super-server-logs/actions/workflows/test.yml)
This library allows you to read and write server logs. In additional to typical ad-hoc logging, it provides a standardized way of capturing **request-response pairs** and **lifecycle events** of processes within a [server cluster](https://nodejs.org/api/cluster.html).
On the writing side, here are its notable features:
* **High throughput**, due to batching (output latency is configurable)
* **Log rotation**, with both size-based and age-based limits, and automatic file cleanup (also configurable)
* **Built-in compression**, resulting in smaller log files (also configurable)
* **Capable of flushing logs** on process exit/crash (except on `SIGKILL` or power outage)
* **Multiple threads/processes** can read and write logs concurrently
* **Retroactive DEBUG logs** are only written when an error occurs
* **Efficient binary log format** is used, but logs can contain arbitrary JSON data
On the reading side, here are its notable features:
* **Built-in binary search**; search billions of logs in milliseconds; find logs within a certain time range
* **Built-in log tailing**, for reading/parsing new logs as they are written
* **High-throughput "bulk" reading**, for efficiently piping logs within a certain time range to external systems
* **Browser support** for all read-based APIs
## Installation
```
npm install super-server-logs
```
> Requires Node.js v18.4.x or later.
# Documentation
- [API documentation for log **_readers_**](./docs/readers.md)
- [API documentation for log **_writers_**](./docs/writers.md)
## License
[MIT](./LICENSE)