Logger for JavaScript inspired by Logback.
---
title: "Outline Diagram"
---
erDiagram
LoggerFactory ||--|{ Logger: ""
Logger }o--o{ Appender: ""
Class | Role |
---|---|
LoggerFactory | Factory class of Loggers. |
Logger | Manage and log Appenders. |
Appender | Define output destination and append log. |
List of Appenders library provides:
Appender | Module | Description |
---|---|---|
Console Appender | @logback4js/core |
Output to console. Core module. |
HTTP POST Appender | @logback4js/core |
Post logging API. Core module. |
IndexedDB Appender | @logback4js/core |
Output to IndexedDB. Core module. |
LocalStorage Appender | @logback4js/core |
Output to LocalStorage. Core module. |
Simple Mail Appender | @logback4js/mail |
Send text mail using Nodemailer. |
Rich Mail Appender | @logback4js/mail |
Send html mail using Nodemailer. |
SQLite Appender | @logback4js/database |
Insert record into SQLite database using node-sqlite3. When using this appender, install sqlite3. It is planed to be migrate node:sqlite after Node.js v20 is going to be EOL. |
PostgreSQL Appender | @logback4js/database |
Insert record into PostgreSQL database using node-postgres. When using this appender, install pg. |
MySQL Appender | @logback4js/database |
Insert record into MySQL database using MySQL2. When using this appender, install mysql2. Not tested yet. |
Redis Appender | @logback4js/database |
Set key into Redis using node-redis. When using this appender, install redis. |
Google Analytics Appender | @logback4js/google-analytics |
Send event using Google Analytics. |
Google Analytics for Firebase Appender | @logback4js/google-analytics |
Send event using Google Analytics for Firebase. |
Slack Appender | @logback4js/slack |
Send message using Slack Web API. Not tested yet. |
Twitter Appender | @logback4js/twitter |
Send message using SDKs wrap the X API. Using this Appender in browser, proxy setting is required to bypass CORS. Not tested yet. |
Microsoft Teams Appender | @logback4js/microsoft |
Send message to Teams using Microsoft Graph. Use workflow with custom HTTP POST Appender might be better. Not tested yet. |
Discord Appender | @logback4js/discord |
Send message using discord.js. Use Discord Webhook Appender might be better. Not tested yet. |
Discord Webhook Appender | @logback4js/discord |
Send message using Discord Webhook. Not tested yet. |
LINE Messaging API Appender | @logback4js/line |
Send message using LINE Messaging API. Not tested yet. |
HTTP POST Appender for Angular | @logback4js/angular |
Send message using Angular HttpClient. |
After release version 1.0.0, follow the rules of Semantic Versioning 2.0.0.
- MAJOR: Update core module including breaking change.
- MINOR: Update core module NOT including breaking change or update others such as adding new features.
- PATCH: Update NOT including behavior change such as update documents or dependencies.
Run npm run build
to build the project. The build artifacts will be stored in the dist/
directory.
Run npm run test
to execute the unit tests via Jest.
# Boot mock
docker compose -f=mock/compose.yaml up -d
# Run unit tests
npm run test