Open fabue opened 8 years ago
@fabue How are the logs unreadable? Is there an extra blank line (perhaps the \r
) per log record? Something else? Can you capture the resultant output to a file or a screenshot or something?
I couldn't reproduce using this log file which has CRLF line endings.
ssh -t dokku@host logs my-weather-service -q -t | bunyan
prints out [1]:
ssh dokku@host logs my-weather-service -q -t | bunyan
prints out [2]:
ssh -t dokku@host logs my-weather-service -q -t | bunyan --color | awk '{sub(/$/,"\r")}1'
prints out [1]. awk '{sub(/$/,"\r")}1'
fixes the line endings.
I must be missing something. Instead of ssh -t dokku@host logs myapp -q -t | bunyan
... is the command more like ssh -t dokku@host 'logs myapp -q -t | bunyan'
? In other words, is bunyan running on the remote host?
Also, apologies if I'm ignorant, but are you saying a pty is requiring apps to emit output using \n\r
for line endings? I've never heard of that. Only: \n
, or \r\n
, or (one old pre-MacOSX mac) \r
.
We use
ssh -t
(request pty) to access logs from a remote machine. We pipe them to bunyan.The requested tty needs
\n\r
as line endings, but bunyan uses\n
, resulting in unreadable logs.Example on MacOS:
ssh -t dokku@host logs myapp -q -t | bunyan