Skip to content

Instantly share code, notes, and snippets.

@dezinezync
Last active November 28, 2018 01:04
Show Gist options
  • Save dezinezync/4527853 to your computer and use it in GitHub Desktop.
Save dezinezync/4527853 to your computer and use it in GitHub Desktop.
Streaming Express.logger's output to logentries
var logStream = {
write: function(message,encoding) {
log.info(message.replace('\n', ''));
}
};
//Application's configuration
app.configure(function() {
//Your base config methods
app.use(express.logger({
format: 'dev', //The format you prefer. This is optional. Not setting this will output the standard log format
stream: logStream //The variable we defined above. The stream method calls the write method.
}));
//Rest of your configuration.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment