How to use the cf-nodejs-logging-support.createWinstonTransport function in cf-nodejs-logging-support

To help you get started, we’ve selected a few cf-nodejs-logging-support examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / cf-nodejs-logging-support / sample / winston-sample / web.js View on Github external
var express = require('express');
var log = require("cf-nodejs-logging-support");
var winston = require('winston');

var app = express();

var logger = winston.createLogger({
    // Bind transport to winston
    transports: [log.createWinstonTransport()]
});

app.get('/', function (req, res) {
    res.send('Hello World');
    logger.log("info", "Received request");
});

app.listen(3000);

// Messages will now be logged exactly as demonstrated by the Custom Messages paragraph
logger.log("info", "Server is listening on port %d", 3000);