4 ms·
If you imagine a log file that gets lines added to it now and then, its actually quite fiddly to do that with XML because of the closing outer tag
by didntreadarticl 4y ago
If you imagine a log file that gets lines added to it now and then, its actually quite fiddly to do that with XML because of the closing outer tag
- planede 4y agoWell, I see the awkwardness of emitting a log like that, but it's not any worse than emitting a single JSON array and waiting for that closing ']'. Both can be emitted and parsed in a streaming fashion though, but I wouldn't say that either XML or JSON is suitable for logs. Maybe NDJSON, but it's more like a hack around this limitation.
- kzrdude 4y agofor json it's common to have multiple records per file. Then it's just one object per line, for example.
- planede 4y agoYes, that's NDJSON, as in newline delimited JSON. http://ndjson.org/ http://ndjson.org/
- jraph 4y ago> but I wouldn't say that either XML or JSON is suitable for logs Of course. Better use a binary format for this. https://systemd.io/JOURNAL_FILE_FORMAT/ https://systemd.io/JOURNAL_FILE_FORMAT/ :-)