Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
26b44e2f
Commit
26b44e2f
authored
Dec 27, 2016
by
张乐
Committed by
GitHub
Dec 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #503 from nobodyiam/client-log-error-as-event
log error as event for apollo-client
parents
67efe969
c24f2a85
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
0 deletions
+8
-0
AbstractConfigRepository.java
.../framework/apollo/internals/AbstractConfigRepository.java
+1
-0
ConfigServiceLocator.java
...trip/framework/apollo/internals/ConfigServiceLocator.java
+2
-0
LocalFileConfigRepository.java
...framework/apollo/internals/LocalFileConfigRepository.java
+1
-0
RemoteConfigLongPollService.java
...amework/apollo/internals/RemoteConfigLongPollService.java
+1
-0
RemoteConfigRepository.java
...ip/framework/apollo/internals/RemoteConfigRepository.java
+3
-0
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/AbstractConfigRepository.java
View file @
26b44e2f
...
@@ -23,6 +23,7 @@ public abstract class AbstractConfigRepository implements ConfigRepository {
...
@@ -23,6 +23,7 @@ public abstract class AbstractConfigRepository implements ConfigRepository {
sync
();
sync
();
return
true
;
return
true
;
}
catch
(
Throwable
ex
)
{
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
logger
logger
.
warn
(
"Sync config failed, will retry. Repository {}, reason: {}"
,
this
.
getClass
(),
ExceptionUtil
.
warn
(
"Sync config failed, will retry. Repository {}, reason: {}"
,
this
.
getClass
(),
ExceptionUtil
.
getDetailMessage
(
ex
));
.
getDetailMessage
(
ex
));
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/ConfigServiceLocator.java
View file @
26b44e2f
...
@@ -14,6 +14,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
...
@@ -14,6 +14,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigException;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ExceptionUtil
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
...
@@ -122,6 +123,7 @@ public class ConfigServiceLocator implements Initializable {
...
@@ -122,6 +123,7 @@ public class ConfigServiceLocator implements Initializable {
logConfigServicesToCat
(
services
);
logConfigServicesToCat
(
services
);
return
;
return
;
}
catch
(
Throwable
ex
)
{
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
transaction
.
setStatus
(
ex
);
exception
=
ex
;
exception
=
ex
;
}
finally
{
}
finally
{
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java
View file @
26b44e2f
...
@@ -141,6 +141,7 @@ public class LocalFileConfigRepository extends AbstractConfigRepository
...
@@ -141,6 +141,7 @@ public class LocalFileConfigRepository extends AbstractConfigRepository
m_fileProperties
=
this
.
loadFromLocalCacheFile
(
m_baseDir
,
m_namespace
);
m_fileProperties
=
this
.
loadFromLocalCacheFile
(
m_baseDir
,
m_namespace
);
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Throwable
ex
)
{
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
transaction
.
setStatus
(
ex
);
exception
=
ex
;
exception
=
ex
;
//ignore
//ignore
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollService.java
View file @
26b44e2f
...
@@ -180,6 +180,7 @@ public class RemoteConfigLongPollService implements Initializable {
...
@@ -180,6 +180,7 @@ public class RemoteConfigLongPollService implements Initializable {
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
transaction
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Throwable
ex
)
{
}
catch
(
Throwable
ex
)
{
lastServiceDto
=
null
;
lastServiceDto
=
null
;
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
transaction
.
setStatus
(
ex
);
long
sleepTimeInSecond
=
m_longPollFailSchedulePolicyInSecond
.
fail
();
long
sleepTimeInSecond
=
m_longPollFailSchedulePolicyInSecond
.
fail
();
logger
.
warn
(
logger
.
warn
(
...
...
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java
View file @
26b44e2f
...
@@ -18,6 +18,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigStatusCodeException;
...
@@ -18,6 +18,7 @@ import com.ctrip.framework.apollo.exceptions.ApolloConfigStatusCodeException;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.tracer.spi.Transaction
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ConfigUtil
;
import
com.ctrip.framework.apollo.util.ExceptionUtil
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpRequest
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpResponse
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
import
com.ctrip.framework.apollo.util.http.HttpUtil
;
...
@@ -213,9 +214,11 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
...
@@ -213,9 +214,11 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
statusCodeException
=
new
ApolloConfigStatusCodeException
(
ex
.
getStatusCode
(),
statusCodeException
=
new
ApolloConfigStatusCodeException
(
ex
.
getStatusCode
(),
message
);
message
);
}
}
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
statusCodeException
));
transaction
.
setStatus
(
statusCodeException
);
transaction
.
setStatus
(
statusCodeException
);
exception
=
statusCodeException
;
exception
=
statusCodeException
;
}
catch
(
Throwable
ex
)
{
}
catch
(
Throwable
ex
)
{
Tracer
.
logEvent
(
"ApolloConfigException"
,
ExceptionUtil
.
getDetailMessage
(
ex
));
transaction
.
setStatus
(
ex
);
transaction
.
setStatus
(
ex
);
exception
=
ex
;
exception
=
ex
;
}
finally
{
}
finally
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment