Switch to just last 100 log lines for now
This commit is contained in:
@@ -36,7 +36,7 @@ class Mrsk::Commands::App < Mrsk::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def logs
|
def logs
|
||||||
[ "docker ps -q #{service_filter.join(" ")} | xargs docker logs -f" ]
|
[ "docker ps -q #{service_filter.join(" ")} | xargs docker logs -n 100 -t" ]
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec(*command, interactive: false)
|
def exec(*command, interactive: false)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def logs
|
def logs
|
||||||
docker :logs, "traefik"
|
docker :logs, "traefik", "-n", "100", "-t"
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_container
|
def remove_container
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ namespace :mrsk do
|
|||||||
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.list_containers) + "\n\n" }
|
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.list_containers) + "\n\n" }
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Tail logs from app containers"
|
desc "Show last 100 log lines from app on servers"
|
||||||
task :logs do
|
task :logs do
|
||||||
on(MRSK.config.hosts) { execute *MRSK.app.logs }
|
on(MRSK.config.hosts) { |host| puts "App Host: #{host}\n" + capture(*MRSK.app.logs) + "\n\n" }
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Remove app containers and images from servers"
|
desc "Remove app containers and images from servers"
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ namespace :mrsk do
|
|||||||
on(MRSK.config.role(:web).hosts) { |host| puts "Traefik Host: #{host}\n" + capture(*MRSK.traefik.info) + "\n\n" }
|
on(MRSK.config.role(:web).hosts) { |host| puts "Traefik Host: #{host}\n" + capture(*MRSK.traefik.info) + "\n\n" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Show last 100 log lines from Traefik on servers"
|
||||||
|
task :logs do
|
||||||
|
on(MRSK.config.hosts) { |host| puts "Traefik Host: #{host}\n" + capture(*MRSK.traefik.logs) + "\n\n" }
|
||||||
|
end
|
||||||
|
|
||||||
desc "Remove Traefik container and image from servers"
|
desc "Remove Traefik container and image from servers"
|
||||||
task remove: %i[ stop ] do
|
task remove: %i[ stop ] do
|
||||||
on(MRSK.config.role(:web).hosts) do
|
on(MRSK.config.role(:web).hosts) do
|
||||||
|
|||||||
Reference in New Issue
Block a user