logsync-node

A simple logging library for Node.js that uses LogSync Servers.


Keywords
typescript, node, logging, server, api, logsync
License
MIT
Install
npm install logsync-node@1.0.0

Documentation

LogSync Node

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

My awesome module

Install

npm install my-package-name

Usage

import { LogApp } from 'log-sync-node';

const logAppInstance = new LogApp({
  MonitorKey: 'YOUR-MONITOR-KEY',
  API_URL: 'https://my-api.com/', // Default is: http://127.0.0.1:8080/
});
// Get your MonitorKey from the Monitor Settings page.
// RECOMMENDED: USE A SECURE SECRETS PROVIDER LIKE DOTENV FOR STORING THE KEY.

const id = await logApp.postLog({
  MonitorId: 1,
  Level: 'info',
  Context:
    'This is just a test, created by LogSync library - ' +
    new Date().toLocaleDateString(),
});
// If successful, the log has been sent to the server and viewable from your website.

Disclaimer

This project requires a API for sending the Logs to a database. This project was made for custom purposes but may eventually in the future be released to the public. If you want to understand more we recommend that you checkout our Github Organization which should include more similar projects while allowing for discussions and contributors.