Miss any of our Open RFC calls?Watch the recordings here! »

@asbjornenge/log-scraper

1.0.7 • Public • Published

LogScraper

Tiny little log scraper.

It follows the docker logs API and assumes you want both stdout and stderr and timestamps. It uses the since parameter to avoid scraping the same logs twice.

Install

npm install --save @asbjornenge/log-scaper

Use

import { createScrapers } from 'log-scraper'
 
let scrapers = createScrapers({},[
    {
        name : 'my-service-1',
        uri  : 'http://my-service-1:8080/logs'
    },
    {
        name : 'my-service-2',
        uri  : 'http://my-docker-host-1:4243/containers/my-service-2/logs'
    }
])
 
scrapers.forEach(s => s.on('data',  dataHandler.bind(undefined, s.service))) 
scrapers.forEach(s => s.on('error', errorHandler)) 
scrapers.forEach(s => s.start())

Changelog

1.0.1

  • Added a build

1.0.0

  • Initial release 🎉

Keywords

none

Install

npm i @asbjornenge/log-scraper

DownloadsWeekly Downloads

0

Version

1.0.7

License

ISC

Last publish

Collaborators

  • avatar