From 8818d4c92a9ced100de48087f8869aa0bc07e988 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sat, 12 Dec 2015 22:48:39 +0000 Subject: Add logging for blaupload controller --- .../uk/co/blatech/blaears/controllers/BlauploadController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/uk/co/blatech/blaears/controllers/BlauploadController.java b/src/main/java/uk/co/blatech/blaears/controllers/BlauploadController.java index bdc801e..cab146d 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/BlauploadController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/BlauploadController.java @@ -16,7 +16,7 @@ import java.io.IOException; @Controller public class BlauploadController { - private static final Logger log = Logger.getLogger(GitPushController.class); + private static final Logger log = Logger.getLogger(BlauploadController.class); @RequestMapping(value = "/blaupload", method = RequestMethod.POST) String notify(@RequestParam("url") String url, @RequestParam("channel") String channel, Model model) { @@ -26,9 +26,10 @@ public class BlauploadController { model.addAttribute("result", "failed"); return "blaupload"; } - + String command = "echo " + channel + " New file uploaded: " + url + " | bash /home/smsd/msgrelay.bash "; + log.info("Running command: [" + command + "]"); try { - Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo " + channel + " New file uploaded: " + url + " | bash /home/smsd/msgrelay.bash "}); + Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", command}); } catch (IOException e) { log.error("Failed to send message to " + channel + " for " + url); e.printStackTrace(); -- cgit v1.2.3