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
When using the json_log_layout layout for structured logging, the records are not separated by a newline or any other separator.
tmp_log<- tempfile()
logger<- logger(appenders= file_appender(file=tmp_log, layout= json_log_layout()))
info(logger, "hungry heart")
info(logger, "everybody want to rule the world")
info(logger, "life during wartime")
readLines(tmp_log)
#> Warning in readLines(tmp_log) :incompletefinallinefoundon'/var/folders/gk/tqr6bd9x5kg4nx12mzy20cww0000gp/T//RtmpYgWnwC/file50109fcb8dc'#> [1] "{\"message\":\"hungry heart\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}{\"message\":\"everybody want to rule the world\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}{\"message\":\"life during wartime\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}"
The expected output should look like:
#> [1] "{\"message\":\"hungry heart\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}"#> [2] "{\"message\":\"everybody want to rule the world\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}"#> [3] "{\"message\":\"life during wartime\",\"level\":\"INFO\",\"time\":\"2024-06-01T18:53:29Z\"}"
When using the
json_log_layout
layout for structured logging, the records are not separated by a newline or any other separator.The expected output should look like:
reprex.qmd.zip
The text was updated successfully, but these errors were encountered: