Log to stdout instead of stderr

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2018-06-14 14:02:12 -04:00
parent 7be81fe60e
commit cc9140b3cc
4 changed files with 72 additions and 0 deletions

View File

@@ -26,6 +26,13 @@ import (
// Ark plugin.
func NewLogger() logrus.FieldLogger {
logger := logrus.New()
/*
!!!DO NOT SET THE OUTPUT TO STDOUT!!!
go-plugin uses stdout for a communications protocol between client and server.
stderr is used for log messages from server to client. The ark server makes sure they are logged to stdout.
*/
// we use the JSON formatter because go-plugin will parse incoming
// JSON on stderr and use it to create structured log entries.