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

https://github.com/furkibuu/aiko_logger

Advanced, colorful logger for Node.js with file rotation, webhook integration and multilingual support (TR/EN)
https://github.com/furkibuu/aiko_logger

console debug discord logger logging nodejs npm-package webhook

Last synced: 1 day ago
JSON representation

Advanced, colorful logger for Node.js with file rotation, webhook integration and multilingual support (TR/EN)

Awesome Lists containing this project

README

          

# ๐Ÿชต aiko.logger

> โšก High-performance, zero-dependency logger for Node.js with JSON
> logging, transports, prefix & webhook support

------------------------------------------------------------------------

![npmversion](https://img.shields.io/npm/v/aiko.logger?style=for-the-badge)
![downloads](https://img.shields.io/npm/dt/aiko.logger?style=for-the-badge)
![license](https://img.shields.io/npm/l/aiko.logger?style=for-the-badge)
![node](https://img.shields.io/node/v/aiko.logger?style=for-the-badge)

------------------------------------------------------------------------

## ๐Ÿš€ Overview

**aiko.logger** is a fast, flexible and production-ready logging library
for Node.js.

- Discord bots ๐Ÿค–\
- APIs & backend services ๐ŸŒ\
- CLI tools ๐Ÿ–ฅ๏ธ

Built with **non-blocking async I/O** and **zero dependencies**.

------------------------------------------------------------------------

## โœจ Features

- โšก Non-blocking async architecture
- ๐ŸŽจ 7 log levels
- ๐Ÿ“ฆ JSON logging support
- ๐Ÿ”Œ Custom transports system
- ๐Ÿงฉ Prefix (scoped loggers)
- ๐ŸŽš๏ธ Log filtering (`minLevel`)
- ๐Ÿ“ Daily log rotation
- ๐Ÿงน Auto cleanup system
- ๐Ÿš€ Discord webhook integration (with embeds)
- ๐Ÿ›ก๏ธ Smart formatting (Object, Array, Error)
- ๐ŸŒ Auto language detection (TR/EN)
- ๐Ÿ“˜ TypeScript support
- ๐Ÿ’Ž Zero dependencies

------------------------------------------------------------------------

## ๐Ÿ“ฆ Installation

``` bash
npm install aiko.logger
```

------------------------------------------------------------------------

## โšก Quick Start

``` js
const { Logger } = require('aiko.logger');

const logger = new Logger({
saveToFile: true,
webhookUrl: 'YOUR_WEBHOOK_URL',
prefix: 'App'
});

logger.info('System started');
logger.error('Something went wrong');
```

------------------------------------------------------------------------

## ๐Ÿงฉ Prefix & Log Filtering

``` js
const dbLogger = new Logger({ prefix: 'MongoDB' });

dbLogger.info('Connection established.');

const webLogger = new Logger({
prefix: 'Express',
minLevel: 'warn'
});

webLogger.info('This will NOT log');
webLogger.error('Timeout!');
```

------------------------------------------------------------------------

## ๐Ÿ“ฆ JSON Logging

``` js
const logger = new Logger({
format: 'json',
saveToFile: true
});
```

Output:

``` json
{
"timestamp": "2026-01-01T12:00:00.000Z",
"level": "INFO",
"message": "System started",
"prefix": "App"
}
```

------------------------------------------------------------------------

## ๐Ÿ”Œ Custom Transports

``` js
logger.addTransport((log) => {
console.log("Custom transport:", log);
});
```

------------------------------------------------------------------------

## ๐Ÿš€ Webhook Integration

- Sends logs as **Discord embeds**
- Includes prefix, level and timestamp

------------------------------------------------------------------------

## ๐Ÿงน Auto Cleanup

``` js
const logger = new Logger({
saveToFile: true,
keepLogsFor: 7,
autoCleanup: true
});
```

------------------------------------------------------------------------

## โš™๏ธ Configuration
```js
Option Description
------------- ---------------------
saveToFile Enable file logging
logFolder Log directory
keepLogsFor Retention days
autoCleanup Delete old logs
webhookUrl Discord webhook
prefix Label logs
minLevel Filter logs
format `text` or `json`
```
------------------------------------------------------------------------

## โš”๏ธ Comparison

Feature aiko.logger winston pino
------------------- ------------- --------- ------
Zero dependency โœ… โŒ โŒ
JSON logging โœ… โœ… โœ…
Custom transports โœ… โœ… โš ๏ธ
Lightweight โœ… โŒ โœ…

------------------------------------------------------------------------

## ๐Ÿš€ Why aiko.logger?

- No dependencies โ†’ no bloat\
- Clean API โ†’ easy to use\
- Production-ready features

------------------------------------------------------------------------

## โญ Support

Give a โญ if you like it!

------------------------------------------------------------------------

## ๐Ÿ“„ License

MIT License