Skip to content

Commit

Permalink
Reduced logging
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenplieger committed Jul 22, 2021
1 parent 0ece7ac commit 0be1a26
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>nl.knmi.adagucservices</groupId>
<artifactId>adaguc-services</artifactId>
<version>1.2.11</version>
<version>1.2.12</version>

<name>adaguc-services</name>
<description>Backend for adaguc-server and adaguc-viewer</description>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/nl/knmi/adaguc/security/AuthenticatorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public synchronized void init(HttpServletRequest request) {
}

x509 = new PemX509Tools().getUserIdFromCertificate(request);
Debug.println("No user info found from certificates");
// Debug.println("No user info found from certificates");
if(x509 == null){
String path = request.getServletPath();

Expand All @@ -84,7 +84,7 @@ public synchronized void init(HttpServletRequest request) {
try {
tokenStr = HTTPTools.getHTTPParam(request, "key");
} catch (Exception e1) {
Debug.println("No access token set in URL via key=<accesstoken> KVP");
// Debug.println("No access token set in URL via key=<accesstoken> KVP");
}
}

Expand All @@ -100,7 +100,7 @@ public synchronized void init(HttpServletRequest request) {


}else{
Debug.println("Unable to find user info from certificate or accesstoken");
// Debug.println("Unable to find user info from certificate or accesstoken");
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ADAGUCRequestMapper {
@CrossOrigin
@RequestMapping("wms")
public void ADAGUCSERVERWMS(HttpServletResponse response, HttpServletRequest request) {
Debug.println("#### SERVLET /wms ####");
// Debug.println("#### SERVLET /wms ####");
try {
ADAGUCServer.runADAGUCWMS(request, response, null, null);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ enum ADAGUCServiceType {

public static void runADAGUC(HttpServletRequest request, HttpServletResponse response, String queryString,
OutputStream outputStream, ADAGUCServiceType serviceType) throws Exception {
Debug.println("runADAGUC");
// Debug.println("runADAGUC");
int maxInstances = ADAGUCConfigurator.getMaxInstances();
int maxInstancesInQueue = ADAGUCConfigurator.getMaxInstancesInQueue();
Exception exception = null;
Expand Down Expand Up @@ -154,7 +154,7 @@ private static void _runADAGUC(HttpServletRequest request, HttpServletResponse r
try {
userHomeDir = UserManager.getUser(authenticator).getHomeDir();
} catch (Exception e) {
Debug.println("No user information provided: " + e.getMessage());
// Debug.println("No user information provided: " + e.getMessage());
}

}
Expand Down Expand Up @@ -197,7 +197,7 @@ private static void _runADAGUC(HttpServletRequest request, HttpServletResponse r
Tools.mksubdirs(tmpDir);
environmentVariables.add("ADAGUC_TMP=" + tmpDir);
String tmpLogFile = tmpDir + "adaguc-server-cgi-log" + instanceId;
Debug.println("Logging to " + tmpLogFile);
// Debug.println("Logging to " + tmpLogFile);
environmentVariables.add("ADAGUC_LOGFILE=" + tmpLogFile);
environmentVariables.add("HOME=" + userHomeDir);
environmentVariables.add("QUERY_STRING=" + queryString);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/nl/knmi/adaguc/tools/CGIRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CGIRunner {
public static int runCGIProgram(String[] commands, String[] environmentVariables, String directory,
final HttpServletResponse response, OutputStream outputStream, String postData, long timeOutMs)
throws InterruptedException, IOException {
Debug.println("Working Directory: " + directory);
// Debug.println("Working Directory: " + directory);

class StderrPrinter implements ProcessRunner.StatusPrinterInterface {
StringBuffer errorMessages = new StringBuffer();
Expand Down Expand Up @@ -175,9 +175,10 @@ public void setPID(String pid) {
timeOutMs);

long startTimeInMillis = Calendar.getInstance().getTimeInMillis();
Debug.println("Starting CGI.");


processRunner.runProcess(commands, postData);
//Debug.println("Starting CGI");
long stopTimeInMillis = Calendar.getInstance().getTimeInMillis();
if (processRunner.exitValue() != 0) {
Debug.errprintln("Warning: exit code: " + processRunner.exitValue());
Expand Down Expand Up @@ -217,7 +218,7 @@ public void setPID(String pid) {
}
}

Debug.println("Finished CGI with code " + processRunner.exitValue() + ": " + " ("
Debug.println("Finished CGI process with code " + processRunner.exitValue() + ": " + " ("
+ (stopTimeInMillis - startTimeInMillis) + " ms)");
try {
outputStream.flush();
Expand Down

0 comments on commit 0be1a26

Please sign in to comment.