diff options
author | Joe Robinson <joe@lc8n.com> | 2015-12-12 22:48:39 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2015-12-12 22:48:39 +0000 |
commit | 8818d4c92a9ced100de48087f8869aa0bc07e988 (patch) | |
tree | 5fc246fe9a12dc8e0121d6b8524591deb43532ef /src | |
parent | 68923c16dff65b54851d0084b5058a927a896f44 (diff) |
Add logging for blaupload controller
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/uk/co/blatech/blaears/controllers/BlauploadController.java | 7 |
1 files changed, 4 insertions, 3 deletions
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(); |