rob05c closed pull request #2982: Update logrotate for grove and change some
messaging from Error to Info level.
URL: https://github.com/apache/trafficcontrol/pull/2982
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/grove/build/grove.logrotate b/grove/build/grove.logrotate
index be57fdc81..afac8d161 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 a1ff499cd..9b3b4d6e9 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 15873bee7..a2d4a5b70 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)
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services