|
|
|
|
|
by zulu-inuoe
1266 days ago
|
|
Say I'm building a logging library, is there any sort of generally agreed-upon standard per what a log file should look like?
I know there's several formats that lnav supports, but I'm not familiar with them. I've always had trouble before figuring out what a good compromise between log format and flexibility looks like. Especially wrt newlines in the log message itself (eg if I want to log a stack trace) Any thoughts for a format that would generally work ootb in lnav or other log viewers? |
|
Of those json is better if you want to be able to do more advanced stuff (nest dictionaries, use lists, ...) and logfmt is better if you want to have human-readable logs without external tools as well, an example line can look like
Some more info here https://www.brandur.org/logfmt