Project

General

Profile

« Previous | Next » 

Revision 2663

Added by sgarg over 18 years ago

Replacing MetaCatUtil.debugMessage or MetaCatUtil.logMetacat call with logMetacat (private Logger object) call

View differences:

RemoteDocument.java
29 29

  
30 30
import edu.ucsb.nceas.utilities.HttpMessage;
31 31
import javax.servlet.ServletOutputStream;
32

  
33
import org.apache.log4j.Logger;
34

  
32 35
import java.io.*;
33 36
import java.net.*;
34 37
import java.util.*;
......
55 58
  private String passWord = null; // The user's passwd
56 59
  private String zipEntry = null; // For zip entry
57 60
  private String revisionAndDocType; // String to store this info
58

  
61
  private Logger logMetacat = Logger.getLogger(RemoteDocument.class);
59 62
  
60 63
  /**
61 64
   * Constructor of RemoteDcoument
......
226 229
    String subString = replicationDocHomeServer.substring(0, index);
227 230
    // Add https at head and append metacat 
228 231
    metacatURL = "https://" + subString +"metacat";
229
    MetaCatUtil.debugMessage("metacatURL: "+metacatURL, 30);
232
    logMetacat.info("metacatURL: "+metacatURL);
230 233
    
231 234
    return metacatURL;
232 235
    
......
292 295
    // User specified docid (including revision number
293 296
    String specifiedDocId = docIdWithoutRevision + 
294 297
                MetaCatUtil.getOption("accNumSeparator") +revision;
295
    MetaCatUtil.debugMessage("The requried docid is: "+ specifiedDocId, 30);
298
    logMetacat.info("The requried docid is: "+ specifiedDocId);
296 299
    
297 300
    // At first login to remote metacat server. 
298 301
    logIn(userName, passWord);
......
363 366
    // User specified docid (including revision number
364 367
    String specifiedDocId = docIdWithoutRevision + 
365 368
                MetaCatUtil.getOption("accNumSeparator") +revision;
366
    MetaCatUtil.debugMessage("The requried docid is: "+ specifiedDocId, 30);
369
    logMetacat.info("The requried docid is: "+ specifiedDocId);
367 370
    
368 371
    // At first login to remote metacat server.
369 372
    logIn(userName, passWord);
......
435 438

  
436 439
    // Now contact metacat and login.
437 440
    String response = getMetacatString(prop);
438
    MetaCatUtil.debugMessage("Login Message: "+response, 30);
441
    logMetacat.info("Login Message: "+response);
439 442
  }//login
440 443
  
441 444
  /**
......
449 452
    prop.put("qformat", "xml");
450 453
    // Send it to remote metacat
451 454
    String response = getMetacatString(prop);
452
    MetaCatUtil.debugMessage("Logout Message: "+response, 55);
455
    logMetacat.debug("Logout Message: "+response);
453 456
    // Set cookie to null
454 457
    HttpMessage.setCookie(null);
455 458
     
......
487 490
    }
488 491
    catch(Exception e)
489 492
    {
490
      MetaCatUtil.debugMessage("Error in RemoteDocument.getMetacatString: "+
491
                               e.getMessage(), 30);
493
      logMetacat.error("Error in RemoteDocument.getMetacatString: "+
494
                               e.getMessage());
492 495
      // If there is some exception return null
493 496
      return null;
494 497
    }

Also available in: Unified diff