From 9352a6048cff723220cd022591d93f9ccd2eb814 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 11 Dec 2015 00:31:03 +0000 Subject: Add log4j for logging --- .../java/uk/co/blatech/blaears/controllers/GitPushController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 c8c39d0..825ce8f 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/GitPushController.java @@ -1,6 +1,7 @@ package uk.co.blatech.blaears.controllers; import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestBody; @@ -18,6 +19,8 @@ import java.io.IOException; @Controller public class GitPushController { + private static final Logger log = Logger.getLogger(GitPushController.class); + @RequestMapping(value = "/git/push", method = RequestMethod.POST) String push(@RequestBody Push pushMsg, Model model){ try { @@ -28,8 +31,8 @@ public class GitPushController { } commitMsg += commit.getMessage(); } + log.info(commitMsg); Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom beep | bash /home/smsd/msgrelay.bash "}); - Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + commitMsg + " | bash /home/smsd/msgrelay.bash "}); //DANGER Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + pushMsg.getUserName() + " pushed to " + pushMsg.getRepository().getName() + ": "+ commitMsg + " | bash /home/smsd/msgrelay.bash "}); -- cgit v1.2.3