This hook only works if the formatter on the logrus logger outputs JSON. This requirement isn't detailed anywhere, or if it is it needs to be more obvious. I had to read the code to notice it attempts to unmarshal the entry string as JSON. The result was null data fields in sumo.
If everyone is agreeable I'll open a PR with 2 changes:
- Update the sample in the README to show the setting of the formatter to
logrus.JSONFormatter
- Following how logrus does it, have the err from
json.Unmarshal printed to stderr.
This hook only works if the formatter on the logrus logger outputs JSON. This requirement isn't detailed anywhere, or if it is it needs to be more obvious. I had to read the code to notice it attempts to unmarshal the entry string as JSON. The result was null data fields in sumo.
If everyone is agreeable I'll open a PR with 2 changes:
logrus.JSONFormatterjson.Unmarshalprinted to stderr.