Skip to content

Commit

Permalink
Fixes container logging recipe to pull logs from all ADWH containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
MattTriano committed Nov 8, 2024
1 parent d64a3c9 commit 1cfe1a0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,13 @@ up_quiet:
docker compose up -d

get_service_logs:
@echo "Saving logs for running services:"
@echo "Saving logs for ADWH services:"
@for service in $(ADWH_SERVICES); do \
service_log_dir="$(LOG_DIR_ALL_SERVICES)/$$service"; \
mkdir -p "$$service_log_dir"; \
if docker compose ps --services --filter "status=running" | grep -q "^$$service$$"; then \
fp="$$service_log_dir/$${service}__logs_$(run_time).log"; \
docker compose logs $$service > $$fp; \
echo " $$service logs saved to $$fp"; \
else \
echo " No container for service $$service found."; \
fi; \
fp="$$service_log_dir/$${service}__logs_$(run_time).log"; \
docker compose logs $$service > $$fp; \
echo " $$service logs saved to $$fp"; \
done
@echo "All logs saved."

Expand Down

0 comments on commit 1cfe1a0

Please sign in to comment.