Commit ee929d7f authored by Kjetil Thuen's avatar Kjetil Thuen

Improved logging

parent 0153f39e
......@@ -30,6 +30,6 @@ public class SMSByFile extends SMSSend {
out.write(prepareMessage(message));
out.close();
logger.info("Saved SMS to " + outputFile.getAbsolutePath());
logger.info("Wrote SMS message to " + outputFile.getAbsolutePath());
}
}
......@@ -27,12 +27,12 @@ public class SMSByScript extends SMSSend {
try {
while (read.ready()) {
logger.info(read.readLine());
logger.debug(read.readLine());
}
int ret = proc.waitFor();
if (ret != 0) {
logger.info("Return value " + ret);
logger.warn("Script return value " + ret);
throw new RuntimeException("Script failed");
}
......
......@@ -56,7 +56,10 @@ public class SMSGateway extends HttpServlet {
if (serviceStatus == 0) {
if (authenticateUser(request)) {
sendSMS(request.getParameter("DESTADDR"), request.getParameter("MESSAGE"), sender);
String number = request.getParameter("DESTADDR");
String message = request.getParameter("MESSAGE");
logger.info(request.getRemoteHost() + " Requested sending a SMS to " + number + " with the content " + message);
sendSMS(number, message, sender);
} else {
httpStatus = 401;
messageID = -1;
......
......@@ -35,7 +35,6 @@ public abstract class SMSSend {
String prefix = getOption("global.message.prefix");
String suffix = getOption("global.message.suffix");
String message = prefix + " " + mainContent + " " + suffix;
logger.info("SMS content: " + message);
return message;
}
}
......@@ -8,7 +8,7 @@
<init-param>
<param-name>sms.sender.implementation</param-name>
<!-- Available implementations: script, file, hand -->
<param-value>script</param-value>
<param-value>hand</param-value>
</init-param>
<init-param>
<param-name>username</param-name>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment