Changeset 7650

Show
Ignore:
Timestamp:
05/05/09 13:47:16 (15 months ago)
Author:
dragisak
Message:

Add info log with duration it takes to finish cross ref call. Addresses #1300

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • head/ambra/webapp/src/main/java/org/topazproject/ambra/admin/service/CrossRefPosterService.java

    r7600 r7650  
    2828import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; 
    2929import org.apache.commons.httpclient.methods.multipart.Part; 
     30import org.apache.commons.logging.Log; 
     31import org.apache.commons.logging.LogFactory; 
    3032 
    3133public class CrossRefPosterService { 
     34 
     35  private static final Log log = LogFactory.getLog(CrossRefPosterService.class); 
     36 
    3237  private String doiXrefUrl; 
    3338 
     
    4752    poster.setRequestEntity(new MultipartRequestEntity(parts, poster.getParams())); 
    4853    client.getHttpConnectionManager().getParams().setConnectionTimeout(25000); 
    49     return client.executeMethod(poster); 
     54    long time = System.currentTimeMillis(); 
     55    int responseCode = client.executeMethod(poster); 
     56    if (log.isInfoEnabled()) 
     57      log.info("CrossRef call to " + doiXrefUrl + " finished with response "+ responseCode + " in " +  
     58          (System.currentTimeMillis() - time) + " ms"); 
     59    return responseCode; 
    5060  } 
    5161}