Last active
November 28, 2018 01:04
-
-
Save dezinezync/4527853 to your computer and use it in GitHub Desktop.
Streaming Express.logger's output to logentries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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