Giter Club home page Giter Club logo

parklog's Introduction

Parklog

Build Status

Simple tool written in Go to redirect your app stdout/stderr to different local or remote endpoints.

Usage

bundle exec rails s | parklog [-c <path_to_config>] [-v]

  • -c <path_to_config> path to the config file (default ./parklog.json)
  • -v verbose

Config example

[
  {
    "url":"file:///dev/stdout",
    "prefix":"Rails app on stdout - "
  },
  {
    "url":"tcp://localhost:9999"
  },
  {
    "url":"tcp://localhost:9998",
    "prefix":"Rails app log on 9998 - "
  },
  {
    "url":"tls://localhost:9997",
    "allow_self_signed_cert": true
  }
]

You can redirect to several endpoints including local files, tcp servers, tls/ssl servers etc ... For a full list of supported endpoints refer to golang net package

You can also inject environment variable inside the parklog.json:

export PORT_A=9999
export URI="file:///dev/stdout"
export PREFIX="Rails app log on 9998 - "
[
  {
    "url":"file://$PWD/log.out"
  },
  {
    "url":"$URI",
    "prefix":"Rails app on stdout - "
  },
  {
    "url":"tcp://localhost:$PORT_A"
  },
  {
    "url":"tcp://localhost:9998",
    "prefix":"$PREFIX"
  },
  {
    "url":"tls://localhost:9997",
    "allow_self_signed_cert": true
  }
]

Hot configuration reload

You can change parklog's config without restarting it. For that you can edit your config file then:

  1. Find parklog's PID (using ps -ef | grep parklog)
  2. Send SIGUSR2 signal to parklog: kill -s USR2 <PID>

If your config file is not valid (i.e contains JSON syntax error), the config changed won't be performed.

Installation

OSX

curl -sL https://github.com/robinmonjo/parklog/releases/download/v0.2.0/parklog_darwin_x86_64.tgz | tar -C /usr/local/bin -zxf -

Linux arm (Raspbery Pi)

curl -sL https://github.com/robinmonjo/parklog/releases/download/v0.2.0/parklog_linux_pi.tgz | tar -C /usr/local/bin -zxf -

Linux

curl -sL https://github.com/robinmonjo/parklog/releases/download/v0.2.0/parklog_linux_x86_64.tgz | tar -C /usr/local/bin -zxf -

License

MIT

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.