node-cloudfoundry-log-reader

0.0.3 • Public • Published

Simple library for read logs applications in Cloud Foundry (Pivotal) instances (only for version CF 182 and older)


Installation

$ npm install node-cloudfoundry-log-reader

Example

var cf = require('node-cloudfoundry-log-reader');
 
var params = {
    username: 'username',
    password: 'password',
    appGuid: 'guid',
    endpoints: {
        loggregator: 'loggregator.cf-domain.com',
        login: 'login.cf-domain.com',
        port: 4443, // port need only for ws (tail log) default value 4443
        ssl: true
    }
};
 
/**
 * Example: cf logs app-name --recent
 */
 
cf.recent(params, function (error, data) {
    console.log(cf.clean(data));
});
 
/**
 * Example: cf logs app-name
 */
 
cf.tail(params, function (socket) {
    socket.on('open', function () {
        console.log('connected');
    });
    socket.on('close', function () {
        console.log('disconnected');
    });
    socket.on('message', function (data) {
        console.log(cf.clean(data.toString()));
    });
    socket.on('error', function () {
        console.log(arguments);
    });
});

More Information

Contributors

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i node-cloudfoundry-log-reader

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • lafin