logserver

command module
v0.0.0-...-cc171e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2019 License: MIT Imports: 4 Imported by: 0

README

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;
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cli
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL