-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in zerolog-writer.go:45 when message has comma in a message body #583
Comments
l.Debug().Msgf(fmt.Sprintf("Renew licenseID: %s, licenseType: %s ", licenseID, licenseType)) |
thanks for reporting! I'll have a fix for this soon |
@polanskya give this a try and let me know if you hit any other snags: #584 |
hey @polanskya would you be willing to work with us on some brainstorming and troubleshooting? We are trying to get a customers perspective on this tooling |
Sure.. please reach out to me at [email protected].. tnx |
Please update your agent and zerologWriter library to the latest versions and let me know if you have any more trouble. The solution for this this is now merged so we are closing. |
Example:
l.Debug().Msgf(fmt.Sprintf("Renew licenseID: %s**,** licenseType: %s ", licenseID, licenseType))
OR
l.Debug().Msg(" Renew licenseID: %s licenseType: %s ", licenseID, licenseType))
When message has a comma in a message string there is parsing exception
valStart := getValueIndex(log, keyEnd)
Get Value index is -1
/usr/local/Cellar/[email protected]/1.17.13/libexec/src/runtime/panic.go:90 (0x1032314)
goPanicIndex: panic(boundsError{x: int64(x), signed: true, y: y, code: boundsIndex})
/Users/XXX/dev/projects/go/pkg/mod/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/[email protected]/zerolog-writer.go:82 (0x150793a)
getValueIndex: if p[i] == ':' {
/Users/XXX/dev/projects/go/pkg/mod/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/[email protected]/zerolog-writer.go:60 (0x1507789)
parseJSONLogData: valStart := getValueIndex(log, keyEnd)
/Users/XXX/dev/projects/go/pkg/mod/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/[email protected]/zerolog-writer.go:45 (0x1507552)
Without commas , message prints correctly.
{"level":"debug","time":"2022-09-22T11:47:04.184074-04:00","caller":"license.go:55","message":"Renew 2.0"}
The text was updated successfully, but these errors were encountered: