Added error handling to logs commands
[#59194468]
Fixed display of log messages ending with new lines
[#59195908]