This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 579a6967 authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Logfilebereinigung: Fix für #68

parent 5d341033
Branches
Tags
1 merge request!17Initial Merge to Prepare Release 1.0.0
package at.ac.uibk.gitsearch.config;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.jhipster.config.JHipsterProperties;
import static io.github.jhipster.config.logging.LoggingUtils.addContextListener;
import static io.github.jhipster.config.logging.LoggingUtils.addJsonConsoleAppender;
import static io.github.jhipster.config.logging.LoggingUtils.addLogstashTcpSocketAppender;
import static io.github.jhipster.config.logging.LoggingUtils.setMetricsMarkerLogbackFilter;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import static io.github.jhipster.config.logging.LoggingUtils.*;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.LoggerContext;
import io.github.jhipster.config.JHipsterProperties;
/*
* Configures the console and Logstash log appenders from the app properties
......@@ -50,5 +55,6 @@ public class LoggingConfiguration {
// disabling some nasty debug logging
context.getLogger("io.netty.util.internal.PlatformDependent0").setLevel(Level.INFO);
context.getLogger("org.glassfish.jersey.client.ClientExecutorProvidersConfigurator").setLevel(Level.INFO);
}
}
package at.ac.uibk.gitsearch.service;
import java.net.ConnectException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;
......@@ -16,6 +17,7 @@ import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.StandardELContext;
import javax.el.ValueExpression;
import javax.ws.rs.ProcessingException;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
......@@ -30,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import com.sun.mail.iap.ConnectionException;
import at.ac.uibk.gitsearch.config.ApplicationProperties;
import at.ac.uibk.gitsearch.service.PluginManagementService.PluginConfigWrapper.ActionWrapper;
......@@ -64,16 +67,21 @@ public class PluginManagementService {
config = target.request().accept(MediaType.APPLICATION_JSON)
.get(SharingPluginConfig.class);
registeredPluginConfigs.put(config.pluginName, new PluginConfigWrapper(config, registeredPluginURL) );
} catch (Exception e) {
log.error("Cannot (re-)load plugin at {}", registeredPluginURL, e);
final Iterator<Entry<String, PluginConfigWrapper>> pluginIterator = registeredPluginConfigs.entrySet().iterator();
while(pluginIterator.hasNext()) {
final Entry<String, PluginConfigWrapper> nextEntry = pluginIterator.next();
if(nextEntry.getValue().getConfigURL().equals(registeredPluginURL)) {
pluginIterator.remove();
break;
}
catch (ProcessingException ce) {
log.warn("Cannot connect to plugin at {}: {}", registeredPluginURL, ce.getMessage());
}
catch (Exception e) {
log.error("Cannot (re-)load plugin at {}", registeredPluginURL, e);
final Iterator<Entry<String, PluginConfigWrapper>> pluginIterator = registeredPluginConfigs
.entrySet().iterator();
while (pluginIterator.hasNext()) {
final Entry<String, PluginConfigWrapper> nextEntry = pluginIterator.next();
if (nextEntry.getValue().getConfigURL().equals(registeredPluginURL)) {
pluginIterator.remove();
break;
}
}
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment