diff --git a/process.go b/process.go index 75b7c4f..e187715 100644 --- a/process.go +++ b/process.go @@ -319,7 +319,7 @@ func (p process) subscriberHandler(natsConn *nats.Conn, thisNode string, msg *na out, err = mh.handler(p, message, thisNode) if err != nil { - er := fmt.Errorf("error: subscriberHandler: failed to execute event: %v", err) + er := fmt.Errorf("error: subscriberHandler: handler method failed: %v", err) sendErrorLogMessage(p.toRingbufferCh, node(thisNode), er) } } else { @@ -353,7 +353,7 @@ func (p process) subscriberHandler(natsConn *nats.Conn, thisNode string, msg *na _, err := mf.handler(p, message, thisNode) if err != nil { - er := fmt.Errorf("error: subscriberHandler: failed to execute event: %v", err) + er := fmt.Errorf("error: subscriberHandler: handler method failed: %v", err) sendErrorLogMessage(p.toRingbufferCh, node(thisNode), er) } } else { diff --git a/subscriber_method_types.go b/subscriber_method_types.go index af3fd60..fe9e6de 100644 --- a/subscriber_method_types.go +++ b/subscriber_method_types.go @@ -454,7 +454,7 @@ func (m methodREQTextToLogFile) handler(proc process, message Message, node stri // Open file and write data. file := filepath.Join(folderTree, fileName) - f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE, os.ModeAppend) + f, err := os.OpenFile(file, os.O_APPEND|os.O_RDWR|os.O_CREATE|os.O_SYNC, os.ModeAppend) if err != nil { log.Printf("error: methodEventTextLogging.handler: failed to open file: %v\n", err) return nil, err