Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
winston-airbrake2
Advanced tools
Readme
A transport for winston that utilises Airbrake
npm install winston-airbrake2
Once installed just add the airbrake transport to your winston with your apiKey:
var winston = require('winston');
winston.add(require('winston-airbrake2').Airbrake, {
apiKey: 'd41d8cd98f00b204e9800998ecf8427e'
});
var message = 'This is my error message';
winston.log('error', message, new Error(message));
Important: to get a meaningful error message logged to your Airbrake project you need to pass an Error object as the meta in winston. Passing an error object will add a stack trace to Airbrake which will allow you to better debug the error:
var message = 'Something went wrong';
winston.log('error', message, new Error(message));
winston.error(message, new Error(message));
All of the options from the node-airbrake module are available.
Option | Default | Description |
---|---|---|
apiKey | null | (Required) The apikey that allows you to post to a specific project, this can be found in the project settings. |
level | 'error' | (Optional) The level that dictates which logs go to airbrake. by default all error messages will be sent. |
host | 'http://' + os.hostname() | (Optional) The information that is displayed within the URL of the Airbrake interface. |
env | process.env.NODE_ENV or 'development' | (Optional) The environment will dictate what happens with your message. If your environment is currently one of the 'developmentEnvironments', the error will not be sent to Airbrake. |
timeout | 30000 | (Optional) The maximum time allowed to send to Airbrake in milliseconds. |
developmentEnvironments | ['development', 'test'] | (Optional) The environments that will not send errors to Airbrake. |
projectRoot | null | (Optional) Extra information sent to Airbrake |
appVersion | null | (Optional) Extra information sent to Airbrake |
consoleLogError | false | (Optional) Toggle the logging of errors when the current environment is in developmentEnvironments |
npm test
FAQs
A transport for winston that sends messages to Airbrake.io
The npm package winston-airbrake2 receives a total of 67 weekly downloads. As such, winston-airbrake2 popularity was classified as not popular.
We found that winston-airbrake2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.