How can I get logs generated by next to be in json format?
Unanswered
Oak shoot sawfly posted this in #help-forum
Oak shoot sawflyOP
My logs are currently line by line, I would like them to be JSON new line delimited for aggregation purposes. I can use a custom logger to achieve this for my manaul logs, but how can I get the logs generated by next to be in this format as well?
7 Replies
You can’t.
Oak shoot sawflyOP
howabout something like https://www.npmjs.com/package/next-logger?
Or if it's not possible in the application I should be able to group them further up the chain? This is mainly a problem when viewing the logs in datadog https://www.datadoghq.com/blog/multiline-logging-guide/#use-a-log-shipper
@Oak shoot sawfly howabout something like https://www.npmjs.com/package/next-logger?
This is about as close as you can get already. I don’t know, nor do I use, datadog
Oak shoot sawflyOP
Sorry, I didn't quite get what you mean by 'This is about as close as you can get already', could you elaborate please?
If you want the build log to be in json format, something like next-logger is the best you can do already. Build logs are not really for analysis in a log data set, they are designed to be human readable not machine readable.
Oak shoot sawflyOP
thanks ❤️