Lädt...

🔧 Send logs to Sumo Logic in Node.js using LogLayer


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Sumo Logic support in the Javascript / Node.js ecosystem is lacking. The sumo-logger package has not been updated in years, most likely due to their adoption of Open Telemetry (otel), and wants you to integrate using an otel stack instead.

What if you don't care about otel, and just want to send logs?

LogLayer offers a Sumo Logic Transport that you can use to send log entries to Sumo Logic.

What is LogLayer

LogLayer is the modern Typescript logging library built for structured logging. It wraps around your favorite logging libraries like pino and winston.

The logging APIs were built for the best developer experience possible:

import { LogLayer, ConsoleTransport } from 'loglayer'

const log = new LogLayer({
  // swap with pino, or multiple loggers
  transport: [
    new ConsoleTransport({
      logger: console,
    })
  ],
})

// Basic logging
log.info('Hello world!')

// Logging with metadata
log.withMetadata({ user: 'john' }).info('User logged in')

// Logging with context (persists across log calls)
log.withContext({ requestId: '123' })

log.info('Processing request') // Will include requestId

// Logging errors
log.withError(new Error('Something went wrong')).error('Failed to process request')

Integrating LogLayer with Sumo Logic

Once you create an HTTP source in Sumo Logic, you can integrate by doing the following:

npm install @loglayer/transport-sumo-logic serialize-error loglayer
import { LogLayer } from "loglayer";
import { SumoLogicTransport } from "@loglayer/transport-sumo-logic";
import { serializeError } from "serialize-error";

const transport = new SumoLogicTransport({
  url: "YOUR_SUMO_LOGIC_HTTP_SOURCE_URL",
});

const logger = new LogLayer({
  errorSerializer: serializeError,  // Important for proper error serialization
  transport
});

logger.info("Hello from LogLayer!");

You should now see logs sent to Sumo Logic!

For more information

...

🔧 Send logs to Sumo Logic in Node.js using LogLayer


📈 93.34 Punkte
🔧 Programmierung

🔧 Writing Logs to Files in Node.js with the LogLayer


📈 50.04 Punkte
🔧 Programmierung

🔧 Taking pretty printing of logs to the next level with LogLayer


📈 43.56 Punkte
🔧 Programmierung

📰 Sumo Logic wrestles with security breach, pins down customer data


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic Completes Investigation Into Recent Security Breach


📈 29.57 Punkte
📰 IT Security Nachrichten

🕵️ Sumo Logic Looks to Hacker-Powered Pen Testing for Security and Compliance


📈 29.57 Punkte
🕵️ Hacking

📰 Week in review: Sumo Logic breach, 7 free cyber threat maps, Patch Tuesday forecast


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic acquires Sensu to expand observability suite


📈 29.57 Punkte
📰 IT Nachrichten

📰 SaaS-Analyse-Plattform: <b>IT</b>-Sicherheitsvorfall bei Sumo Logic | heise online


📈 29.57 Punkte
📰 IT Security Nachrichten

🕵️ Sumo Logic Looks to Hacker-Powered Pen Testing for Security and Compliance


📈 29.57 Punkte
🕵️ Hacking

📰 SaaS-Analyse-Plattform: IT-Sicherheitsvorfall bei Sumo Logic


📈 29.57 Punkte
📰 IT Nachrichten

📰 Sumo Logic acquires DFLabs to combat modern threat challenges


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic Urges Users to Change Credentials Due to Security Breach


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Cloud Experte Sumo Logic baut mit Novolos 01 GmbH seine DACH-Präsenz aus


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic discloses security breach, advises API key resets


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic stärkt Präsenz und Partnernetzwerk


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 SaaS-Analyse-Plattform: IT-Sicherheitsvorfall bei Sumo Logic


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic Stock Surges 22% on First Day of Trading


📈 29.57 Punkte
📰 IT Security Nachrichten

🕵️ Sumo Logic discloses security breach and recommends customers rotate credentials


📈 29.57 Punkte
🕵️ Hacking

🎥 Elastic Security 7.9, Sumo Logic, &amp; Attivo Networks - ESW #196


📈 29.57 Punkte
🎥 IT Security Video

📰 Sumo Logic discloses potential breach via compromised AWS credential


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Innovator Spotlight: Sumo Logic


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Westcon bietet Sumo Logic-Plattform an


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic discloses potential breach via compromised AWS credential


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic vs Splunk: Which Is Better For Big Data Log Analysis? | UpGuard


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic acquires JASK Labs


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic launches HELM Chart V4 to unify data collection on Kubernetes clusters


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic Acquires JASK to Expand Cloud-Native Platform


📈 29.57 Punkte
📰 IT Security Nachrichten

📰 Sumo Logic Ponders Why We Aren't There Yet With Security Automation


📈 29.57 Punkte
📰 IT Security Nachrichten

🔧 Sumo Logic and Tracetest: AI-Driven Observability Meets Testing


📈 29.57 Punkte
🔧 Programmierung

matomo