Giter Club home page Giter Club logo

log.io's Introduction

Log.io - Real-time log monitoring in your browser

Powered by node.js + socket.io

License Version Node

How does it work?

A file input watches log files for changes, sends new messages to the server via TCP, which broadcasts to browsers via socket.io.

Users can watch adhoc log streams by activating inputs and binding them to multiple screens via the web UI.

Terminology

Stream - A logical designation for a group of messages that relate to one another. Examples include an application name, a topic name, or a backend service name.

Source - A physical designation for a group of messages that originate from the same source. Examples include a server name, a service provider name, or a filename.

Input - A (stream, source) pair.

While originally designed to represent backend service logs spread across multiple servers, the stream/source abstraction is intentionally open-ended to allow users to define a system topology for their specific use case.

Install & run server

Install via npm

npm install -g log.io

Configure hosts & ports (see example below)

nano ~/.log.io/server.json

Run server

log.io-server

Browse to http://localhost:6688

Install & run file input

Install via npm

npm install -g log.io-file-input

Configure file input (see example below)

nano ~/.log.io/inputs/file.json

Run file input

log.io-file-input

Server configuration

There are two servers: the message server, which receives TCP messages from message inputs, and the HTTP server, which receives requests from browsers. By default, the application looks for configuration in ~/.log.io/server.json, and can be overridden with the environment variable LOGIO_SERVER_CONFIG_PATH.

Sample configuration file:

{
  "messageServer": {
    "port": 6689,
    "host": "127.0.0.1"
  },
  "httpServer": {
    "port": 6688,
    "host": "127.0.0.1"
  },
  "debug": false
}

File input configuration

Inputs are created by associating file paths with stream and source names in a configuration file. By default, the file input looks for configuration in ~/.log.io/inputs/file.json, and can be overridden with the environment variable LOGIO_FILE_INPUT_CONFIG_PATH.

Sample configuration file:

{
  "messageServer": {
    "host": "127.0.0.1",
    "port": 6689
  },
  "inputs": [
    {
      "source": "server1",
      "stream": "app1",
      "config": {
        "path": "log.io-demo/file-generator/app1-server1.log"
      }
    },
    {
      "source": "server2",
      "stream": "app1",
      "config": {
        "path": "log.io-demo/file-generator/app1-server2.log"
      }
    },
    {
      "source": "server1",
      "stream": "app2",
      "config": {
        "path": "log.io-demo/file-generator/app2-server1.log"
      }
    },
    {
      "source": "server2",
      "stream": "app2",
      "config": {
        "path": "log.io-demo/file-generator/app2-server2.log"
      }
    }
  ]
}

Server TCP interface

The file input connects to the server via TCP, and writes properly formatted strings to the socket. Custom inputs can send messages to the server using the following commands, each of which ends with a null character:

Send a log message

+msg|streamName1|sourceName1|this is log message\0

Register a new input

+input|streamName1|sourceName1\0

Remove an existing input

-input|streamName1|sourceName1\0

log.io's People

Contributors

msmathers avatar fzerorubigd avatar

Stargazers

redzed501 avatar

Watchers

James Cloos avatar

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.