Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transport logging improvements #94

Merged
merged 3 commits into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onJobSuccess(final Job job, final Object value) {
public void onJobFailed(final Job job, final Throwable value) {
final boolean knownCause = value != null;
// convenience method for extension hooks
log.error("Exception while running job:", knownCause ? value.getMessage() : "");
log.error("Exception while running job:", knownCause ? value.getMessage() : "Unknown error", job.getKey());
if(knownCause) {
log.debug(value, "Stacktrace");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public ReferencedEnvelope createEnlargedEnvelope(double width, double height) {
@JsonIgnore
public ReferencedEnvelope getEnlargedEnvelope() {
if(this.enlargedEnvelope == null) {
log.error("Enlarged envelope not created");
log.warn("Enlarged envelope not created");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be logged as just debug.

if(this.envelope == null) {
this.getEnvelope();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ private void initMapLayerJob(final long requestId, SessionStore store, String la
private String getOskariUid(SessionStore store) {
String sessionId = store.getSession();
String route = store.getRoute();
log.warn( JobHelper.getAPIUrl() + UID_API);
return HttpHelper.getHeaderValue(JobHelper.getAPIUrl() + UID_API,
JobHelper.getCookiesValue(sessionId, route), KEY_UID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public static boolean hasPermission(String layerId, String sessionId, String rou
String json = WFSLayerPermissionsStore.getCache(sessionId);
boolean fromCache = json != null;
if(!fromCache) {
log.warn(getAPIUrl() + PERMISSIONS_API);
json = HttpHelper.getRequest(getAPIUrl() + PERMISSIONS_API, getCookiesValue(sessionId, route));
if(json == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ public void notifyError() {

public void notifyError(String error) {
if (error == null) {
error = "Something went wrong";
error = "Layer could not be loaded - reason unknown";
}
log.error("On Error - layer:", layerId, "type:", type, "msg:", error);
Map<String, Object> output = createCommonResponse(error, WFSExceptionHelper.ERROR_COMMON_JOB_FAILURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ protected void featuresHandler() {

// send values
if(!this.sendFeatures) {
log.warn("Didn't request properties - skipping", fid);
continue;
}
Point centerPoint = WFSParser.getGeometryCenter(geometry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public HystrixJob(final String groupName, final String commandName) {
.withQueueSizeRejectionThreshold(PropertyUtil.getOptional("oskari." + groupName + ".job.pool.limit", 100)))
.andCommandPropertiesDefaults(
HystrixCommandProperties.Setter()
.withExecutionTimeoutInMilliseconds(PropertyUtil.getOptional("oskari." + groupName + ".job.timeoutms", 15000)))
.withExecutionTimeoutInMilliseconds(PropertyUtil.getOptional("oskari." + groupName + ".job.timeoutms", 25000))
.withCircuitBreakerRequestVolumeThreshold(PropertyUtil.getOptional("oskari." + groupName + ".failrequests", 5))
.withMetricsRollingStatisticalWindowInMilliseconds( PropertyUtil.getOptional("oskari." + groupName + ".rollingwindow", 100000))
.withCircuitBreakerSleepWindowInMilliseconds(PropertyUtil.getOptional("oskari." + groupName + ".sleepwindow", 20000)))
);
}

Expand Down