some GO logs not going to SUMO?

38 Views Asked by At

I have cloud function that sets up a connection to sumo logs with log.addHook() and that works just fine for the most part, but some messages dont make it to sumo but exist in the cloud function logs?

There is an Init() function that sets the hook up, there is a main function that grabs a file and goes to the reader function.

the function that reads the file works just fine, but one step out of it (sendMessage function) and now my hook is gone?

funcFileReader(...){

    forEach line of file{
        if condition {
            sendMessage(...)
        }
    }
...more code...
    log.WithFields(log.Fields{
        "EOF":            true,
        "fileType":       fileType.ToString(),
        ...,
    }).Info("file complete")
}

func sendMessage(...) Document {
    log.WithFields(log.Fields{
        "accountNumber": ...,
        "fileDate":      ...,
        "fileType":      ...,
    }).Info("message sent")
}

the EOF message makes it into SUMO but the sendMessage one doesn't?

did i loose my hook in the stack somehow?

I've tried moving the logs around and debugging the log object but thats proven to be a futile adventure. There is no way i can see to check the values of the logrus object while debugging.

0

There are 0 best solutions below