Changeset 1746


Ignore:
Timestamp:
09/16/14 13:58:20 (10 years ago)
Author:
pharms
Message:
  • added logging of user agent
Location:
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorLogManager.java

    r1227 r1746  
    127127                    if (writer == null) { 
    128128                        writer = new HtmlMonitorOutputWriter 
    129                             (logFileBaseDir, clientInfos.getWebAppId(), clientInfos.getClientId()); 
     129                            (logFileBaseDir, clientInfos.getWebAppId(), 
     130                             clientInfos.getClientId(), clientInfos.getUserAgent()); 
    130131 
    131132                        writer.init(); 
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java

    r1430 r1746  
    7474 
    7575    /** 
     76     * the user agent used by the client 
     77     */ 
     78    private String userAgent; 
     79 
     80    /** 
    7681     * the log file into which all messages are currently written 
    7782     */ 
     
    105110     * @param clientId       the ID of the client, for which this writer logs 
    106111     */ 
    107     public HtmlMonitorOutputWriter(String logFileBaseDir, String webAppId, String clientId) { 
     112    public HtmlMonitorOutputWriter(String logFileBaseDir, 
     113                                   String webAppId, 
     114                                   String clientId, 
     115                                   String userAgent) 
     116    { 
    108117        if (logFileBaseDir == null) { 
    109118            this.logFileBaseDir = new File(DEFAULT_LOG_FILE_BASE_DIR); 
     
    115124        this.webAppId = webAppId; 
    116125        this.clientId = clientId; 
     126        this.userAgent = userAgent; 
    117127         
    118128        lastUpdate = System.currentTimeMillis(); 
     
    442452        outputWriter = new PrintWriter(new OutputStreamWriter(fis, "UTF-8")); 
    443453        outputWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 
    444         outputWriter.println("<session>"); 
     454        outputWriter.print("<session webapp=\""); 
     455        outputWriter.print(StringTools.xmlEntityReplacement(this.webAppId)); 
     456        outputWriter.print("\" clientId=\""); 
     457        outputWriter.print(StringTools.xmlEntityReplacement(this.clientId)); 
     458        outputWriter.print("\" userAgent=\""); 
     459        outputWriter.print(StringTools.xmlEntityReplacement(this.userAgent)); 
     460        outputWriter.println("\">"); 
    445461         
    446462        loggedGUIElements.clear(); 
Note: See TracChangeset for help on using the changeset viewer.