express-requests-loggly
v0.1.2
Published
Log Express requests (including those with errors) to Loggly.
Downloads
4
Readme
express-requests-loggly
Log Express requests (including those with errors) to Loggly.
Installation
Install using npm:
npm install express-requests-loggly
API Reference
##class: LogglyRequestLogger ⏏ Members
###new LogglyRequestLogger(settings) Create a new request logger.
Params
- settings
Object
- client
loggly.Client
- client
Returns: LogglyRequestLogger
Example
var logger = new LogglyRequestLogger({
client: loggly.createClient({
token: 'KEY',
subdomain: 'SUBDOMAIN',
json: true
})
});
###express-requests-loggly.requestHandler() Capture and log express requests.
Returns: function
- returns express middleware
Example
app.use(logger.requestHandler());
###express-requests-loggly.errorHandler()
Add errors to req.error
before logging.
Returns: function
- reutrns express error handler middleware
Example
app
.use(logger.requestHandler())
.use(app.router)
.use(logger.errorHandler())
.use(express.errorHandler());
Contributing
Please submit all issues and pull requests to the BuildingConnected/express-requests-loggly repository!
Tasks
List available tasks with gulp help
.
Tests
Run tests using npm test
or gulp test
.
Support
If you have any problem or suggestion please open an issue here.