Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

lafin/node-cloudfoundry-log-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Node module for reading logs apps from cloud foundry

Resources

License

Stars

Watchers

Forks