🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

node-loggly-bulk

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-loggly-bulk

A client implementation for Loggly cloud Logging-as-a-Service API

4.0.2
latest
Source
npm
Version published
Weekly downloads
223K
48.16%
Maintainers
2
Weekly downloads
 
Created

What is node-loggly-bulk?

The node-loggly-bulk package is a Node.js client for Loggly, a cloud-based log management service. This package allows you to send logs to Loggly in bulk, which can be more efficient than sending logs one at a time. It supports both single and bulk log sending, and it can handle different log levels and tags.

What are node-loggly-bulk's main functionalities?

Send a single log

This feature allows you to send a single log message to Loggly. You need to create a client with your Loggly token and subdomain, and then use the `log` method to send a log message.

const loggly = require('node-loggly-bulk');
const client = loggly.createClient({
  token: 'your-really-long-input-token',
  subdomain: 'your-subdomain',
  tags: ['global-tag'],
  json: true
});

client.log('Hello, Loggly!', function (err, result) {
  if (err) {
    console.error('Error sending log:', err);
  } else {
    console.log('Log sent:', result);
  }
});

Send multiple logs in bulk

This feature allows you to send multiple log messages to Loggly in a single request. This can be more efficient than sending logs one at a time. You pass an array of log messages to the `log` method.

const loggly = require('node-loggly-bulk');
const client = loggly.createClient({
  token: 'your-really-long-input-token',
  subdomain: 'your-subdomain',
  tags: ['global-tag'],
  json: true
});

const logs = [
  'First log message',
  'Second log message',
  'Third log message'
];

client.log(logs, function (err, result) {
  if (err) {
    console.error('Error sending logs:', err);
  } else {
    console.log('Logs sent:', result);
  }
});

Send logs with different tags

This feature allows you to send a log message with custom tags. You can specify tags for individual log messages, which can be useful for categorizing and filtering logs in Loggly.

const loggly = require('node-loggly-bulk');
const client = loggly.createClient({
  token: 'your-really-long-input-token',
  subdomain: 'your-subdomain',
  tags: ['global-tag'],
  json: true
});

client.log({message: 'Log with custom tag', tags: ['custom-tag']}, function (err, result) {
  if (err) {
    console.error('Error sending log:', err);
  } else {
    console.log('Log sent:', result);
  }
});

Other packages similar to node-loggly-bulk

Keywords

cloud computing

FAQs

Package last updated on 14 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts