Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 203622 | Differences between
and this patch

Collapse All | Expand All

(-)config/Apache/error/v1.3.26/static.adapter (-2 / +3 lines)
Lines 26-31 Link Here
26
        <pu:Property propertyName="fileName" propertyValue=""/>
26
        <pu:Property propertyName="fileName" propertyValue=""/>
27
        <pu:Property propertyName="parserClassName" propertyValue="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/>
27
        <pu:Property propertyName="parserClassName" propertyValue="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/>
28
        <pu:Property propertyName="version" propertyValue="default"/>
28
        <pu:Property propertyName="version" propertyValue="default"/>
29
        <pu:Property propertyName="timezone" propertyValue=""/>
29
        <sensor:StaticParserSensor directory="" fileName="" parserClassName="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/>
30
        <sensor:StaticParserSensor directory="" fileName="" parserClassName="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/>
30
      </cc:Sensor>
31
      </cc:Sensor>
31
      <cc:Outputter description="Static Parser Outputter" uniqueID="AdapterStaticParserOutputterID1" type="LoggingAgentOutputter">
32
      <cc:Outputter description="Static Parser Outputter" uniqueID="AdapterStaticParserOutputterID1" type="LoggingAgentOutputter">
Lines 33-44 Link Here
33
        <pu:Property propertyName="waitUntilLoggingTime" propertyValue="15000"/>
34
        <pu:Property propertyName="waitUntilLoggingTime" propertyValue="15000"/>
34
        <op:LoggingAgentOutputterType agentName="Apache HTTP Server V1.3.20, V1.3.26, V2.0 error log files" waitUntilLoggingTime="15000"/>
35
        <op:LoggingAgentOutputterType agentName="Apache HTTP Server V1.3.20, V1.3.26, V2.0 error log files" waitUntilLoggingTime="15000"/>
35
      </cc:Outputter>
36
      </cc:Outputter>
36
      <cc:Outputter description="CBE File Outputter" uniqueID="ND2DA2480E9C11DB8000DF587DEE0353" disabled="true" type="SingleFileOutputter">
37
      <cc:Outputter description="CBE File Outputter" disabled="true" uniqueID="ND2DA2480E9C11DB8000DF587DEE0353" type="SingleFileOutputter">
37
        <pu:Property propertyName="directory" propertyValue="."/>
38
        <pu:Property propertyName="directory" propertyValue="."/>
38
        <pu:Property propertyName="fileName" propertyValue="example.out"/>
39
        <pu:Property propertyName="fileName" propertyValue="example.out"/>
39
        <op:SingleFileOutputterType directory="." fileName="example.out"/>
40
        <op:SingleFileOutputterType directory="." fileName="example.out"/>
40
      </cc:Outputter>
41
      </cc:Outputter>
41
      <cc:Outputter description="CBE Logging Agent Outputter" uniqueID="NEF1E7880E9C11DB8000DF587DEE0353" disabled="true" type="LoggingAgentOutputter">
42
      <cc:Outputter description="CBE Logging Agent Outputter" disabled="true" uniqueID="NEF1E7880E9C11DB8000DF587DEE0353" type="LoggingAgentOutputter">
42
        <pu:Property propertyName="agentName" propertyValue="Default CBE Logging Agent"/>
43
        <pu:Property propertyName="agentName" propertyValue="Default CBE Logging Agent"/>
43
        <op:LoggingAgentOutputterType agentName="Default CBE Logging Agent"/>
44
        <op:LoggingAgentOutputterType agentName="Default CBE Logging Agent"/>
44
      </cc:Outputter>
45
      </cc:Outputter>
(-)src/org/eclipse/hyades/logging/parsers/AbstractErrorLogParser.java (-31 / +45 lines)
Lines 115-121 Link Here
115
    protected String sourceID = null;
115
    protected String sourceID = null;
116
116
117
    //Private variables:
117
    //Private variables:
118
    
118
    /**
119
	 * Variable to hold the tempTimezone value
120
	 */
121
	private String timezone;	
119
    /**
122
    /**
120
     * bugzilla 139164
123
     * bugzilla 139164
121
     * Count of records with identical time stamp values. 
124
     * Count of records with identical time stamp values. 
Lines 150-156 Link Here
150
    public void setConfiguration(Hashtable table) throws LogParserException {
153
    public void setConfiguration(Hashtable table) throws LogParserException {
151
    	super.setConfiguration(table);
154
    	super.setConfiguration(table);
152
    	sensorFilterExitHelper.init(table , filterExitClassInstance) ;
155
    	sensorFilterExitHelper.init(table , filterExitClassInstance) ;
156
    	timezone = (String)table.get("timezone");
157
        inittimezone();
153
    }
158
    }
159
	/*
160
	 * Intialize the timezone value to the system default timezone value 
161
	 */
162
	  private void inittimezone()
163
	  {
164
	  	if(timezone == null || timezone.equals("") || timezone.equals("default")||timezone.equals("Default"))
165
	  	{
166
	  		timezone = "";
167
	  		//intialize the timezone value
168
	  		Calendar localCalendar = Calendar.getInstance();
169
	  	    int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000);                
170
	  	    if (utcOffset < 0) {
171
	  	    	timezone = timezone.concat("-");
172
	  	    }
173
	  	    else {
174
	  	    	timezone = timezone.concat("+");
175
	  	    }
176
	  	    utcOffset = Math.abs(utcOffset);
177
	  	    // Compute the Time Zone value (+/-hh:mm)
178
	  	    String numberHours = String.valueOf(utcOffset / 60);
179
	  	    if (numberHours.length() == 1) {
180
	  	    	timezone = timezone.concat("0");
181
	  	    }
182
	  	    timezone = timezone.concat(numberHours);
183
	  	    timezone = timezone.concat(":");
184
	  	    String numberMinutes = String.valueOf(utcOffset % 60);
185
	  	    if (numberMinutes.length() == 1) {
186
	  	    	timezone = timezone.concat("0");
187
	  	    }
188
	  	    timezone = timezone.concat(numberMinutes);
189
	  	}
190
	  	else
191
	  	{
192
	  		StringBuffer tempTimezone = new StringBuffer(timezone);
193
	  		tempTimezone.insert(3, ':');
194
	  		timezone = tempTimezone.toString();
195
	  	}
196
	  }
154
    
197
    
155
    /**
198
    /**
156
     * Initialize this parser.
199
     * Initialize this parser.
Lines 555-591 Link Here
555
598
556
                //Add the fractional second value (e.g. .000000):
599
                //Add the fractional second value (e.g. .000000):
557
                currentTimeStamp.append(ParserConstants.SIX_ZERO);
600
                currentTimeStamp.append(ParserConstants.SIX_ZERO);
558
559
                //Generate the local UTC offset using the parsed date:
601
                //Generate the local UTC offset using the parsed date:
560
                Calendar localCalendar = Calendar.getInstance();
602
                currentTimeStamp.append(timezone);
561
                localCalendar.setTime(creationDate);
562
                int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000);
563
564
                //Add the sign of the UTC offset:
565
                if (utcOffset < 0)
566
                    currentTimeStamp.append("-");
567
                else
568
                    currentTimeStamp.append("+");
569
570
                utcOffset = Math.abs(utcOffset);
571
572
                // Time Zone (+/-hh:mm)
573
574
                String numberHours = String.valueOf(utcOffset / 60);
575
576
                if (numberHours.length() == 1)
577
                    currentTimeStamp.append("0");
578
579
                currentTimeStamp.append(numberHours);
580
                currentTimeStamp.append(":");
581
582
                String numberMinutes = String.valueOf(utcOffset % 60);
583
584
                if (numberMinutes.length() == 1)
585
                    currentTimeStamp.append("0");
586
587
                currentTimeStamp.append(numberMinutes);
588
589
                return true;
603
                return true;
590
            }
604
            }
591
        }
605
        }

Return to bug 203622