Getting logs from two Docker containers #58
-
Hello,
But when I enter the first line, the program shows : |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The reason you can't enter multiple log forwarding commands in the same terminal is because When you run: docker logs my-container1 --follow --tail=10 | logdy forward 8551 The terminal stays "busy" because:
This is why you need separate terminals/tabs - each streaming operation needs its own process to run continuously. Opening new tabs allows you to run multiple independent streaming processes simultaneously. The simplest approach is to use Ubuntu's native terminal tabs. Just press # First tab
docker logs my-container1 --follow --tail=10 | logdy forward 8551
# Switch to new tab (Ctrl+Shift+T)
docker logs my-container2 --follow --tail=10 | logdy forward 8552 You can switch between tabs using No additional software or complex configuration needed - it's all built into your Ubuntu terminal. |
Beta Was this translation helpful? Give feedback.
The reason you can't enter multiple log forwarding commands in the same terminal is because
docker logs --follow
is a "blocking" operation - it continuously streams logs in real-time and keeps the process running. This is by design, as it needs to stay active to monitor and forward new log entries as they appear.When you run:
docker logs my-container1 --follow --tail=10 | logdy forward 8551
The terminal stays "busy" because:
--follow
flag tells Docker to continuously watch for new logs|
) streams these logs to logdy in real-timeThis is why you need separate terminals/tabs - each streaming…