Simple HTTP server to log POST request content to file
Homepage: https://github.com/fabrom/log-http2file
Report bugs on https://github.com/fabrom/log-http2file/issues
npm install log-http2file
To download a zip, go to the Log-HTTP2File on Github
Usage: log-http2file [options] <outputfile>
Simple HTTP server to log POST request content to file
Options:
-h, --help output usage information
-V, --version output the version number
-w, --workers <n> how many listening workers
-p, --port <n> listening port
./log-http2file [options] output_file_path
Look at forever tool for running this server in production.
- -w workers count (default=(CPUs/2)+1)
- -p listening port (default=8142)
SIGHUP signal stop workers, rename current log file with adding current datetime and start new workers.
Example : x.log will be renamed to x_201605281900.log
Ctrl+C on console mode, SIGINT, SIGTERM or SIGBREAK signals will stop workers and main process.
Send simple HTTP POST request to the server.
Example :
curl -X POST \
--data "This line will be write in the output file open by the Log-HTTP2File server" \
--header "Content-Type:text/plain" \
http://localhost:8142
You should look at log.io for log monitoring.
Log-HTTP2File is available under the MIT license.