This is an automated email from the ASF dual-hosted git repository. rob pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push: new da85c75 This changes some error messaging in grove to 'Info' log level as these messages are more informative than they are errors and they are filling up the error.logs. Also updates logrotate to add in error.log rotation. da85c75 is described below commit da85c754ffebd08e9bc4bc3c3f269cdff3168691 Author: John Rushford <jrushf...@apache.org> AuthorDate: Thu Nov 1 18:08:55 2018 +0000 This changes some error messaging in grove to 'Info' log level as these messages are more informative than they are errors and they are filling up the error.logs. Also updates logrotate to add in error.log rotation. --- grove/build/grove.logrotate | 11 +++++++++++ grove/cache/handler.go | 6 +++--- grove/web/listener.go | 4 ++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/grove/build/grove.logrotate b/grove/build/grove.logrotate index be57fdc..afac8d1 100644 --- a/grove/build/grove.logrotate +++ b/grove/build/grove.logrotate @@ -34,3 +34,14 @@ rotate 5 copytruncate } + +/var/log/grove/error.log { + compress + maxage 30 + missingok + nomail + size 100M + rotate 5 + copytruncate +} + diff --git a/grove/cache/handler.go b/grove/cache/handler.go index a1ff499..9b3b4d6 100644 --- a/grove/cache/handler.go +++ b/grove/cache/handler.go @@ -175,10 +175,10 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { conn := (*web.InterceptConn)(nil) if realConn, ok := h.conns.Get(r.RemoteAddr); !ok { - log.Errorf("RemoteAddr '%v' not in Conns (reqid %v)\n", r.RemoteAddr, reqID) + log.Infof("RemoteAddr '%v' not in Conns (reqid %v)\n", r.RemoteAddr, reqID) } else { if conn, ok = realConn.(*web.InterceptConn); !ok { - log.Errorf("Could not get Conn info: Conn is not an InterceptConn: %T (reqid %v)\n", realConn, reqID) + log.Infof("Could not get Conn info: Conn is not an InterceptConn: %T (reqid %v)\n", realConn, reqID) } } @@ -186,7 +186,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if err == nil { // if we failed to get a remapping, there's no DSCP to set. if err := conn.SetDSCP(remappingProducer.DSCP()); err != nil { - log.Errorln(time.Now().Format(time.RFC3339Nano) + " " + r.RemoteAddr + " " + r.Method + " " + r.RequestURI + ": could not set DSCP: " + err.Error() + " (reqid " + strconv.FormatUint(reqID, 10) + ")") + log.Infoln(time.Now().Format(time.RFC3339Nano) + " " + r.RemoteAddr + " " + r.Method + " " + r.RequestURI + ": could not set DSCP: " + err.Error() + " (reqid " + strconv.FormatUint(reqID, 10) + ")") } } diff --git a/grove/web/listener.go b/grove/web/listener.go index 15873be..a2d4a5b 100644 --- a/grove/web/listener.go +++ b/grove/web/listener.go @@ -39,7 +39,7 @@ func getConnStateCallback(connMap *ConnMap) func(net.Conn, http.ConnState) { fallthrough case http.StateIdle: if iconn, ok := conn.(*InterceptConn); !ok { - log.Errorf("ConnState callback: idle conn is not a InterceptConn: '%T'\n", conn) + log.Infof("ConnState callback: idle conn is not a InterceptConn: '%T'\n", conn) } else { // MUST be zeroed when the conn moves to Idle, because the Active callback happens _after_ some/all bytes have been read iconn.bytesRead = 0 @@ -48,7 +48,7 @@ func getConnStateCallback(connMap *ConnMap) func(net.Conn, http.ConnState) { connMap.Remove(conn.RemoteAddr().String()) case http.StateActive: if iconn, ok := conn.(*InterceptConn); !ok { - log.Errorf("ConnState callback: active conn is not a InterceptConn: '%T'\n", conn) + log.Infof("ConnState callback: active conn is not a InterceptConn: '%T'\n", conn) } else { connMap.Add(iconn) }