I am using supervisord to run my golang app. My supervisord conf looks like
[program:go_web]
command=go-web-app
autostart=true
autorestart=true
startsecs=3
stdout_logfile=/var/log/app.log
stderr_logfile=/var/log/app_error.log
and my logrus setup looks:
package main
import (
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
)
func main() {
log.SetFormatter(&logrus.TextFormatter{
ForceColors: true,
})
log.Info("this is an info")
log.Error("this is an error")
}
However I found both log in my error log /var/log/app_error.log
INFO[0000] this is an info
ERRO[0000] this is an error
How can I make info logging to my app log /var/log/app.log
and error logging to error log var/log/app_error.log
automatically.
Thanks