TypeScript icon, indicating that this package has built-in type declarations

3.0.6 • Public • Published


Feature branch build npm version install size

Quality checks Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Conventional Commits

FOSSA Status

What is it?

It is an extendable isomorphic log sending library written in TypeScript for javascript application in nodejs and browsers.

It can be extended with custom strategy ("when to send logs") and service ("where to send logs").

It does not restrict you with conventions, for example, existence of "logSeverity", "ErrorId" or "message" fields in log.

It supports any format of logs via custom serializer.


  • 🙀 It works in browsers and nodejs
  • 🚛 It is able to send single logs and bundles of them to an external logger
  • It supports different log sending strategies:
    1. interval (for example, every 10 seconds)
    2. 📢 on request (only when you ask)
    3. 📢 mixed ("interval" + "on request") (will be done soon)
    4. 🚂 🚃 🚃 🚃 on bundle size (for example, sends bundles of 100 logs)
    5. 🚽 instant (received 1 log -> sent 1 log)
  • 👥 It is able to group duplicated logs in certain time interval (for rapid fire of the same logs)
  • 🐙 It is not afraid of circular links in log objects
  • 🏗️ It supports custom format for logs (custom serializer)
  • 🎯 It supports different remote logger endpoints (SumoLogic, Loggly and Elasticsearch). Who is the next? ᕙ(ಠ.ಠ)ᕗ

Runtime environment support 🏃‍♀️

Builds are generated as ES2015 bundles for nodejs and browser environments.

🤖 NodeJS - tested on latest lts

🌐 Browser - all latest browsers, that support ES2015 JS.


Complete documentation and examples can be found here:

Advanced Logger's Homepage

NPM package link

Simplest usage

Now, the boring part 🤓


Axios is a required peer dependency. It means that axios is not bundled into logger package, but required to be installed.

As a dependency in a npm project:

npm i --save advanced-logger axios
import {AdvancedLogger, service, strategy} from 'advanced-logger';
// or
const {AdvancedLogger, service, strategy} = require('advanced-logger');

As script tags with CDN:

<script src=""></script>
<script src=""></script>
<!--dev version-->
<script src=""></script>
<script src=""></script>


Lets initiate a logger that sends all logs instantly to Sumologic service.

import {AdvancedLogger, service, strategy} from 'advanced-logger';

const defaultLogConfig = {
    UserAgent: window.userAgent,
    Channel: "my-company",
    BuildVersion: 123,
    Platform: "browser",
    Severity: "DEBUG",
    Data: "",
    Timestamp: "",
    Message: "",
    Category: ""

const serviceConfig = {
    url: "",
    sourceName: "advancedLoggerTest",
    host: "advanced-logger",
    sourceCategory: "MY/SUMO/namespace",
    method: "POST"

const config = {serviceConfig, defaultLogConfig};

const logger = new AdvancedLogger({
    service: new service.SumologicService(config),
    strategy: new strategy.InstantStrategy()

logger.log({test: "instant log u1"}); // sends log message :rocket:
logger.log({test: "instant log u2"}); // sends log message :rocket:
logger.log({test: "instant log u3"}); // sends log message :rocket:

Upgrading between breaking changes

2.x to 3.x

  • Install axios to your project or just keep using it if it is already installed
  • Logger is compiled to ES2015 JS target. If your project requires support of old browsers and nodejs, please, make sure that you transpile and add necessary pollyfills to the build

Package Sidebar


npm i advanced-logger

Weekly Downloads






Unpacked Size

409 kB

Total Files


Last publish


  • oleksiipopov