From 51ed9d04eafb6469ad1dc13f482858f42ca9dab7 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 11 Dec 2015 17:23:23 +0000 Subject: Add extra logging --- .../java/uk/co/blatech/blaears/controllers/GitPushController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java b/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java index eca58ec..ab9971d 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java @@ -39,10 +39,13 @@ public class GitPushController { log.info("Received commits: " + commitMsg); //DANGER - Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + pushMsg.getUserName() + " pushed to " + pushMsg.getRepository().getName() + ": "+ commitMsg + " | bash /home/smsd/msgrelay.bash "}); + String command = "echo theblueroom " + pushMsg.getUserName() + " pushed to " + pushMsg.getRepository().getName() + ": "+ commitMsg + " | bash /home/smsd/msgrelay.bash "; + log.info("Running command: " + command); + + Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", command}); model.addAttribute("result", "OK"); } catch (IOException e) { - System.out.println("Failed to run command"); + log.error("Failed to run command"); e.printStackTrace(); model.addAttribute("result", "failed"); } -- cgit v1.2.3