View Javadoc
1   /**
2    * @author mchyzer
3    * $Id: TfRestLogicTrafficLog.java,v 1.1 2013/06/20 06:02:50 mchyzer Exp $
4    */
5   package edu.internet2.middleware.grouper.app.adobe;
6   
7   import java.util.Map;
8   
9   import org.apache.commons.logging.Log;
10  import org.apache.commons.logging.LogFactory;
11  
12  import edu.internet2.middleware.grouperClient.util.GrouperClientUtils;
13  
14  
15  
16  /**
17   * logger to log the traffic of box
18   */
19  public class GrouperAdobeLog {
20  
21    /** logger */
22    private static final Log LOG = edu.internet2.middleware.grouper.util.GrouperUtil.getLog(GrouperAdobeLog.class);
23   
24    /**
25     * log something to the log file
26     * @param message
27     */
28    public static void adobeLog(String message) {
29      LOG.debug(message);
30    }
31    
32    /**
33     * log something to the log file
34     * @param messageMap
35     * @param startTimeNanos nanos when the request started
36     */
37    public static void adobeLog(Map<String, Object> messageMap, Long startTimeNanos) {
38      if (LOG.isDebugEnabled()) {
39        if (messageMap != null && startTimeNanos != null) {
40          messageMap.put("elapsedMillis", (System.nanoTime() - startTimeNanos) / 1000000);
41        }
42        LOG.debug(GrouperClientUtils.mapToString(messageMap));
43      }
44    }
45  
46    
47  }