Make Your Logs Work for You

The days of logging in to servers and manually viewing log files are over. SolarWinds® Papertrail™ aggregates logs from applications, devices, and platforms to a central location.

View Technology Info

FEATURED TECHNOLOGY

Troubleshoot Fast and Enjoy It

SolarWinds® Papertrail™ provides cloud-based log management that seamlessly aggregates logs from applications, servers, network devices, services, platforms, and much more.

View Capabilities Info

FEATURED CAPABILITIES

Aggregate and Search Any Log

SolarWinds® Papertrail™ provides lightning-fast search, live tail, flexible system groups, team-wide access, and integration with popular communications platforms like PagerDuty and Slack to help you quickly track down customer problems, debug app requests, or troubleshoot slow database queries.

View Languages Info

FEATURED LANGUAGES

TBD - APM Integration Title

TBD - APM Integration Description

TBD Link

APM Integration Feature List

TBD - Built for Collaboration Title

TBD - Built for Collaboration Description

TBD Link

Built for Collaboration Feature List

Join SolarWinds Day October 19 to see the next evolution in observability. Register now.

Collect Logs: Apps & Services > Node.js

Node.js

Papertrail can accept logs from any Node.js app using a regular text log file or the libraries winston or bunyan.

If the Node.js app is running on Heroku, try the Heroku setup instead.

Send log file with remote_syslog2

Have Node log to a file, then transmit the log file to Papertrail using remote_syslog2.

To make Node log to a file, either redirect its output or use the fs module. For example, to redirect stdout to myapp.log, start the daemon with:

$ nohup node myapp.js > myapp.log &

Send events from Node.js

To asynchronously transmit events from Node.js, use the winston-syslog transport:

const os = require('os');
const winston = require('winston');
require('winston-syslog');

const papertrail = new winston.transports.Syslog({
host: 'logsN.papertrailapp.com',
port: XXXXX,
protocol: 'tls4',
localhost: os.hostname(),
eol: '\n',
});

const logger = winston.createLogger({
format: winston.format.simple(),
levels: winston.config.syslog.levels,
transports: [papertrail],
});

logger.info('hello papertrail');

See the README for more information about the winston-syslog transport. To log unhandled exceptions, see the winston documentation.

If syslog isn’t available, Winston’s native HTTP transport can be used with Papertrail’s Token-based destination. This sends messages using a non-customizable JSON format.

const winston = require('winston');

const papertrail = new winston.transports.Http({
host: 'logs.collector.solarwinds.com',
path: '/v1/log',
auth: { username: new String(''), password: 'TOKEN' },
ssl: true,
});

const logger = winston.createLogger({
transports: [papertrail],
});

logger.info('hello papertrail');

node-bunyan users can use the node-bunyan-syslog stream.

Related

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.