You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add a new writer that supports JSON output to the console instead of a file.
There is an existing json writer, but it currently only supports writing out to a file.
One can simulate JSON output to the console using the console writer, but it is easy to run into some gotchas. Given the below tinylog.properties file...
...notice the writer.format line. It simulates JSON, but it becomes invalid JSON if the message has multiple lines (e.g. \n) or a JSON-reserved character (e.g. "). This can easily happen if there is an exception's stacktrace being logged.
So, while one can accomplish a simple simulation of JSON console logging, I believe tinylog will benefit from adding a native JSON writer to the console that fully supports JSON.
The text was updated successfully, but these errors were encountered:
Please add a new writer that supports JSON output to the console instead of a file.
There is an existing
json
writer, but it currently only supports writing out to a file.One can simulate JSON output to the console using the
console
writer, but it is easy to run into some gotchas. Given the belowtinylog.properties
file......notice the
writer.format
line. It simulates JSON, but it becomes invalid JSON if themessage
has multiple lines (e.g.\n
) or a JSON-reserved character (e.g."
). This can easily happen if there is an exception's stacktrace being logged.So, while one can accomplish a simple simulation of JSON console logging, I believe tinylog will benefit from adding a native JSON writer to the console that fully supports JSON.
The text was updated successfully, but these errors were encountered: