# Loggly Appender

Sends logging events to Loggly (opens new window), optionally adding tags. This appender uses node-loggly-bulk (opens new window). Consult the docs for node-loggly-bulk, or loggly itself, if you want more information on the configuration options below.

npm install --save @tsed/logger-loggly
1

# Configuration

  • type - loggly
  • options.token - string - your really long input token
  • options.subdomain - string - your subdomain
  • options.auth - object (optional) - authentication details
    • username - string
    • password - string
  • options.tags - Array<string> (optional) - tags to include in every log message

See all available options for Loggly here (opens new window).

# Example

import {Logger} from "@tsed/logger";
import "@tsed/logger-loggly";

const logger = new Logger("loggerName");

logger.appenders.set("stdout", {
  type: "loggly",
  level: ["info"],
  options: {
    token: "somethinglong",
    subdomain: "your.subdomain",
    tags: ["tag1"]
  }
});

logger.info({tags: ["my-tag-1", "my-tag-2"]}, "Some message");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

This will result in a log message being sent to loggly with the tags tag1, my-tag-1, my-tag-2.

Last Updated: 10/26/2023, 6:30:07 AM

Other topics