Giter Club home page Giter Club logo

logio's Introduction

Logio

Logio is a system for publishings log streams to a server and fanning them out to client subscriptions. It consists of a server and simple PUB/SUB client implementations. Configured apps publish logs to a topic via a TCP stream and clients subscribe to one or more topics for a live stream of logs. The result is similar experience to Heroku's log plexing service, only self-hosted.

Usage

Server

Spinning up a Logio server is as simple as the following:

$ docker run --rm -it -p 7701:7701 -p 7702:7702  kevincantwell/logio
Listening for subscribers on tcp :7702
Listening for publishers on tcp :7701

Publisher

A publisher is any app that produces logs. This project includes a Go package that will re-configure the default logger to publish logs to a server. Setting it up is as simple as importing the package and configuring a single connection string:

import _ "github.com/kevin-cantwell/logio"
$ export LOGIO_URL='logio://logio-server.example.com:7701?app=myapp&proc=web&host=foobar'

If you are familiar with Redis the connection string above will makes sense to you:

  • logio is the schema and indicates that this is a Logio server we're connecting to
  • logio-server.example.com is the domain where the Logio server is hosted.
  • 7701 is the default port which handles log publications
  • app, proc, and host define the topic to which logs are published. Only app is required. The proc and host values default to the name of the running process and the hostname, respecively. Usually only app and proc are specified.

Subscriber

A subscriber is any client that requests logs on one or more topics. A topic is composed of app, proc, and host. Subscribers may specify regex patterns that match multiple topics, thereby stitching multiple log streams into one (fan-out pattern).

The below subscription matches any apps named myapp with a process named either web or worker:

$ curl -N 'http://logio-server.example.com:7702?app=myapp&proc=web|worker'
2016-12-06T22:14:21.448 myapp[worker] i-10-45-22-14: 2016/12/06 17:14:21 INFO This is a worker log
2016-12-06T22:14:21.567 myapp[web] i-10-34-20-12: 2016/12/06 17:14:21 ERROR This is a web error
2016-12-06T22:14:21.782 myapp[web] i-10-34-20-12: 2016/12/06 17:14:21 INFO This is a web log
2016-12-06T22:14:21.901 myapp[web] i-10-34-20-12: 2016/12/06 17:14:21 INFO This is a web log

The output of a log subscription is formatted like so:

<timestamp> <app>[<proc>] <host>: <log>

logio's People

Contributors

kevin-cantwell avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

bscott

logio's Issues

Implement a cli tool for subscribing to topics

Currently curl can be used to open a streaming http connection:

curl -N 'http://logio-server.example.com:7702?app=myapp&proc=web|worker'

A cli tool should exist to facilitate configuring and opening connections and sending commands to the server.

Implement auth

Publishers and subscribers should authenticate as the same user.

Ideally a user/pass combination would be used to auth with the server. This could be similar to how Redis works. Ie: The connection string would include the basic auth info.

Implement network security

The pub/sub communication is sent in plaintext over TCP. This is fine for servers hosted within a private network. If a server is communicating logs via the internet, it would be best if those messages were secured via TLS.

I'm not sure, but it may also be possible to encrypt/decrypt the traffic to/from the server with user certs. This could make a hosted solution safer for users. Especially since logs often contain sensitive information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.