Code Monkey home page Code Monkey logo

logserver's Introduction

LogServer

The Go server for monitoring log files.

Install

go get -U github.com/moisespsena/logserver
cd $GOPATH/src/github.com/moisespsena/logserver
go build

Run

./logserver

Access http://localhost:4000/file/test.log

Configuration

The sample configurarion file is conf/sample.ini.

Or

./logserver -sampleConfig

For customize configurations and show it:

./logserver -conf conf/sample.init -printConfig

CLI Options

./logserver -h
Usage of ./logserver:
  -config string
        The Config File. Example: cfg.init
  -printConfig
        Print Default INI Config
  -sampleConfig
        Print Sample INI Config

Nginx Proxy Pass Example

Your serverUrl config example:

...
serverUrl  = PROTO://HOST/sub/path
serverAddr = 127.0.0.1:4000
...

Nginx conf:

location /sub/path/ws/ {
    proxy_set_header X-Real-IP       $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Upgrade         websocket;
    proxy_set_header Connection      upgrade;
    proxy_set_header Host            $host:$server_port;
    proxy_set_header Origin          $scheme://$host:$server_port;
    proxy_http_version               1.1;
    proxy_pass                       http://localhost:4000;
    # proxy_pass                       http://unix:/var/run/logger.sock;
}

location /sub/path {
    proxy_set_header X-Real-IP       $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header                 Host $host:$server_port;
    proxy_set_header Origin          $scheme://$host:$server_port;
    proxy_http_version               1.1;
    proxy_pass                       http://localhost:4000;
    # proxy_pass                       http://unix:/var/run/logger.sock;
}

logserver's People

Contributors

moisespsena avatar

Watchers

 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.