I need to have my logs in .json
format and currently I use express-js server and my logs looks the following:
Error: Cannot return null for non-nullable field Query.get_bar.
Error: Cannot return null for non-nullable field Query.get_bar.
Error: Cannot return null for non-nullable field Query.get_foo.
I figured out there're some logger frameworks (log4js, winstonjs) but I don't want to log manually (i.e., console.log(123)
), I'm interested in redirecting my STDOUT, converting it to JSON and writing to some .log
file.
What's the most simple solution for this task?
Update: there's a related issue on GitHub.