A log server for neo-cli with LogPlugin
- save logs from your consensus node into files
- transfer your logs to partner, another LogServer
warning: LogServer2.0 integrated with LogMonitor you dont need to deploy logmonitor anymore.
install go at least v1.10 use with LogPlugin v1.0.0
- git clone https://github.com/neo-ngd/LogServer.git into your $GOPATH/github.com/neo-ngd
cd LogServer && go run main.go
- https://github.com/neo-ngd/LogServer/releases
- unzip LogServer-${version}-${platform}.zip
- for linux
./main
- for windows
main.exe
after installation, configure your this application in config.json
{
"name": "ngd",//the name of your node, let partners to recognize you
"rport": 8080, //the port receive log
"sport": 8081, //the port serve web api
"logpath": "./persist",//directory to store the log
"logname": "concensus.log",//log file name
"logfileexpire": 30,//day, how many days you want to store the log
"logfilesplit": 1,//hour, how many hours to split the file into
"sendto":[//partners you want to send your log
"http://ngd1.logbackend:8080/log"
]
}
if you want to send your consensus node logs to partners, set your partners' LogServer url in "sendto"
set your node name to let partners recognize you, LogServer use name to set in Http Header "From" when sending to partner.
"rport " is for serving cn-node LogPlugin using "http://logserverip:rport/log" and LogMonitor using "http://logserverip:sport".
LogServer can both receive logs from cn and provide LogMonitor LogPlugin: put "http://LogServerIP:port/log" into config.json of LogPlugin. LogMonitor: use "http://LogServerIP:port" to visit web service directly.