diff --git a/servlet.go b/servlet.go index 71fcebc..ea0f7d9 100644 --- a/servlet.go +++ b/servlet.go @@ -120,6 +120,8 @@ func (s *rpcServlet) Context() ServletContext { func handleServlet(s *rpcServlet) { var err error + logging.Logger().Info(fmt.Sprintf("Servlet is started")) + defer func() { s.doneChan <- err s.stopWg.Done() @@ -152,8 +154,12 @@ func handleServlet(s *rpcServlet) { } func handleReader(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { + logging.Logger().Debug(fmt.Sprintf("reader of Servlet is started")) + var err error defer func() { + logging.Logger().Debug(fmt.Sprintf("reader of Servlet is stopped")) + if r := recover(); r != nil { if err == nil { err = fmt.Errorf("RPC Server: Panic when reading request from client: %v", r) @@ -191,8 +197,11 @@ func handleReader(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { } func handleWriter(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { + logging.Logger().Debug(fmt.Sprintf("writer of Servlet is started")) + var err error defer func() { + logging.Logger().Debug(fmt.Sprintf("writer of Servlet is stopped")) if r := recover(); r != nil { if err == nil { err = fmt.Errorf("RPC Server: Panic when writing response to client: %v", r)