
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
bunyan-seq
Advanced tools
A Bunyan stream to send events to Seq. Tested with Node.js versions 4.2.2 and up.
First, install bunyan-seq
as a global tool:
npm install -g bunyan-seq
Then, pipe the output of your bunyan-enabled app to it:
node your-app.js | bunyan-seq --serverUrl http://localhost:5341 --apiKey 1234567890 --property application=ExampleApp
bunyan-seq
accepts the following parameters:
serverUrl
- this is the base URL of your Seq server; if omitted, the default value of http://localhost:5341
will be usedapiKey
- your Seq API key, if one is required; the default does not send an API keylogOtherAs
- log other output (not formatted through bunyan) to seq at this loglevel. Useful to capture messages if the node process crashes or smilar.property
- add additional properties to all logs sent to SeqYou can specify property names as tokens in the log message to control how the event is rendered in Seq:
// Seq will render this as 'Hi, Alice!'
log.info({ user: 'Alice' }, 'Hi, {user}!');
The full message template syntax is documented here.
To enable capture of output not formatted through bunyan use the logOtherAs
parameter. It's possible to use different settings for STDOUT
/STDERR
like this, when using bash:
node your-app.js `
2> >(bunyan-seq --logOtherAs Error --serverUrl http://localhost:5341 --apiKey 1234567890) `
> >(bunyan-seq --logOtherAs Information --serverUrl http://localhost:5341 --apiKey 1234567890)
Use the createStream()
method to create a Bunyan stream configuration, passing serverUrl
, apiKey
and batching parameters.
let bunyan = require('bunyan');
let seq = require('bunyan-seq');
var log = bunyan.createLogger({
name: 'myapp',
streams: [
{
stream: process.stdout,
level: 'warn'
},
seq.createStream({
serverUrl: 'http://localhost:5341',
level: 'info',
reemitErrorEvents: true,
onError: (e) => {
console.error('[SeqStreamCustomError] failed to log events:', e);
}
})
]
});
log.info('hi');
log.warn({ lang: 'fr' }, 'au revoir');
Read the complete documentation.
FAQs
A Bunyan stream that sends log events to Seq
The npm package bunyan-seq receives a total of 5,552 weekly downloads. As such, bunyan-seq popularity was classified as popular.
We found that bunyan-seq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.