Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 83391 Details for
Bug 203622
Apache Error log static parser does not use timezone specified by user in import dialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
203622.txt (text/plain), 6.29 KB, created by
Rohit Shetty
on 2007-11-20 23:47:19 EST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rohit Shetty
Created:
2007-11-20 23:47:19 EST
Size:
6.29 KB
patch
obsolete
>Index: config/Apache/error/v1.3.26/static.adapter >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.logging.parsers/config/Apache/error/v1.3.26/static.adapter,v >retrieving revision 1.8 >diff -u -r1.8 static.adapter >--- config/Apache/error/v1.3.26/static.adapter 11 Mar 2007 06:35:08 -0000 1.8 >+++ config/Apache/error/v1.3.26/static.adapter 21 Nov 2007 04:42:52 -0000 >@@ -26,6 +26,7 @@ > <pu:Property propertyName="fileName" propertyValue=""/> > <pu:Property propertyName="parserClassName" propertyValue="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/> > <pu:Property propertyName="version" propertyValue="default"/> >+ <pu:Property propertyName="timezone" propertyValue=""/> > <sensor:StaticParserSensor directory="" fileName="" parserClassName="org.eclipse.hyades.logging.parsers.ApacheErrorLogParser"/> > </cc:Sensor> > <cc:Outputter description="Static Parser Outputter" uniqueID="AdapterStaticParserOutputterID1" type="LoggingAgentOutputter"> >@@ -33,12 +34,12 @@ > <pu:Property propertyName="waitUntilLoggingTime" propertyValue="15000"/> > <op:LoggingAgentOutputterType agentName="Apache HTTP Server V1.3.20, V1.3.26, V2.0 error log files" waitUntilLoggingTime="15000"/> > </cc:Outputter> >- <cc:Outputter description="CBE File Outputter" uniqueID="ND2DA2480E9C11DB8000DF587DEE0353" disabled="true" type="SingleFileOutputter"> >+ <cc:Outputter description="CBE File Outputter" disabled="true" uniqueID="ND2DA2480E9C11DB8000DF587DEE0353" type="SingleFileOutputter"> > <pu:Property propertyName="directory" propertyValue="."/> > <pu:Property propertyName="fileName" propertyValue="example.out"/> > <op:SingleFileOutputterType directory="." fileName="example.out"/> > </cc:Outputter> >- <cc:Outputter description="CBE Logging Agent Outputter" uniqueID="NEF1E7880E9C11DB8000DF587DEE0353" disabled="true" type="LoggingAgentOutputter"> >+ <cc:Outputter description="CBE Logging Agent Outputter" disabled="true" uniqueID="NEF1E7880E9C11DB8000DF587DEE0353" type="LoggingAgentOutputter"> > <pu:Property propertyName="agentName" propertyValue="Default CBE Logging Agent"/> > <op:LoggingAgentOutputterType agentName="Default CBE Logging Agent"/> > </cc:Outputter> >Index: src/org/eclipse/hyades/logging/parsers/AbstractErrorLogParser.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.logging.parsers/src/org/eclipse/hyades/logging/parsers/AbstractErrorLogParser.java,v >retrieving revision 1.12 >diff -u -r1.12 AbstractErrorLogParser.java >--- src/org/eclipse/hyades/logging/parsers/AbstractErrorLogParser.java 13 Jun 2007 04:47:14 -0000 1.12 >+++ src/org/eclipse/hyades/logging/parsers/AbstractErrorLogParser.java 21 Nov 2007 04:42:52 -0000 >@@ -115,7 +115,10 @@ > protected String sourceID = null; > > //Private variables: >- >+ /** >+ * Variable to hold the tempTimezone value >+ */ >+ private String timezone; > /** > * bugzilla 139164 > * Count of records with identical time stamp values. >@@ -150,7 +153,47 @@ > public void setConfiguration(Hashtable table) throws LogParserException { > super.setConfiguration(table); > sensorFilterExitHelper.init(table , filterExitClassInstance) ; >+ timezone = (String)table.get("timezone"); >+ inittimezone(); > } >+ /* >+ * Intialize the timezone value to the system default timezone value >+ */ >+ private void inittimezone() >+ { >+ if(timezone == null || timezone.equals("") || timezone.equals("default")||timezone.equals("Default")) >+ { >+ timezone = ""; >+ //intialize the timezone value >+ Calendar localCalendar = Calendar.getInstance(); >+ int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000); >+ if (utcOffset < 0) { >+ timezone = timezone.concat("-"); >+ } >+ else { >+ timezone = timezone.concat("+"); >+ } >+ utcOffset = Math.abs(utcOffset); >+ // Compute the Time Zone value (+/-hh:mm) >+ String numberHours = String.valueOf(utcOffset / 60); >+ if (numberHours.length() == 1) { >+ timezone = timezone.concat("0"); >+ } >+ timezone = timezone.concat(numberHours); >+ timezone = timezone.concat(":"); >+ String numberMinutes = String.valueOf(utcOffset % 60); >+ if (numberMinutes.length() == 1) { >+ timezone = timezone.concat("0"); >+ } >+ timezone = timezone.concat(numberMinutes); >+ } >+ else >+ { >+ StringBuffer tempTimezone = new StringBuffer(timezone); >+ tempTimezone.insert(3, ':'); >+ timezone = tempTimezone.toString(); >+ } >+ } > > /** > * Initialize this parser. >@@ -555,37 +598,8 @@ > > //Add the fractional second value (e.g. .000000): > currentTimeStamp.append(ParserConstants.SIX_ZERO); >- > //Generate the local UTC offset using the parsed date: >- Calendar localCalendar = Calendar.getInstance(); >- localCalendar.setTime(creationDate); >- int utcOffset = ((localCalendar.get(Calendar.ZONE_OFFSET) + localCalendar.get(Calendar.DST_OFFSET)) / 60000); >- >- //Add the sign of the UTC offset: >- if (utcOffset < 0) >- currentTimeStamp.append("-"); >- else >- currentTimeStamp.append("+"); >- >- utcOffset = Math.abs(utcOffset); >- >- // Time Zone (+/-hh:mm) >- >- String numberHours = String.valueOf(utcOffset / 60); >- >- if (numberHours.length() == 1) >- currentTimeStamp.append("0"); >- >- currentTimeStamp.append(numberHours); >- currentTimeStamp.append(":"); >- >- String numberMinutes = String.valueOf(utcOffset % 60); >- >- if (numberMinutes.length() == 1) >- currentTimeStamp.append("0"); >- >- currentTimeStamp.append(numberMinutes); >- >+ currentTimeStamp.append(timezone); > return true; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203622
:
83391
|
83861