是否有编写和解析JSON
个日志(log)文件的格式标准?
我看到的问题是,你不能有一个"纯"JSON
日志(log)文件,因为你需要匹配的括号和尾随逗号是禁止的.因此,虽然以下内容可能由应用程序编写,但标准JSON parsers:
无法解析
[{date:'2012-01-01 02:00:01', severity:"ERROR", msg:"Foo failed"},
{date:'2012-01-01 02:04:02', severity:"INFO", msg:"Bar was successful"},
{date:'2012-01-01 02:10:12', severity:"DEBUG", msg:"Baz was notified"},
So you must have some conventions on how to structure your log files in a way that a parser can process them. The easiest thing would be "one log message object per line, newlines in string values are escaped". Are there any existing standards and tools?