List of usage examples for org.apache.commons.logging LogFactory getLog
public static Log getLog(String name)
From source file:fr.aliasource.webmail.indexing.ConversationsIndexer.java
public ConversationsIndexer(IAccount account, SearchDirector sd) { logger = LogFactory.getLog(getClass()); this.sd = sd; this.account = account; if (logger.isDebugEnabled()) { logger.debug("Conversation listener created for account " + account.getUserId()); }//from w w w. ja v a2s. com }
From source file:fr.aliasource.webmail.server.proxy.client.http.AbstractClientMethod.java
protected AbstractClientMethod(HttpClient hc, String backendUrl, String action) { this.logger = LogFactory.getLog(getClass()); this.hc = hc; this.url = backendUrl + action; }
From source file:net.jperf.commonslog.aop.EjbTimingAspect.java
protected CommonsLogStopWatch newStopWatch(String loggerName, String levelName) { int levelInt = CommonsLogStopWatch.mapLevelName(levelName); return new CommonsLogStopWatch(LogFactory.getLog(loggerName), levelInt, levelInt); }
From source file:com.adaptris.security.TestConfiguredUrl.java
/** @see TestCase */ public TestConfiguredUrl(String testName) { super(testName); if (logR == null) { logR = LogFactory.getLog(TestConfiguredUrl.class); }/* w w w. j a va 2 s.c o m*/ }
From source file:fr.aliasource.webmail.ldap.Configuration.java
public Configuration(ProxyConfiguration pc) { logger = LogFactory.getLog(getClass()); init(pc); }
From source file:fr.aliasource.webmail.proxy.XmlMailMessageParser.java
public XmlMailMessageParser() { logger = LogFactory.getLog(getClass()); }
From source file:fedora.server.security.servletfilters.pubcookie.ConnectPubcookie.java
private static final HttpMethodBase setup(HttpClient client, URL url, Map requestParameters, Cookie[] requestCookies) {// w w w.j av a 2 s . com LogFactory.getLog(ConnectPubcookie.class).debug(ConnectPubcookie.class.getName() + ".setup()"); HttpMethodBase method = null; if (requestParameters == null) { LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " requestParameters == null"); method = new GetMethod(url.toExternalForm()); //GetMethod is superclass to ExpectContinueMethod, so we don't require method.setUseExpectHeader(false); LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " after getting method"); } else { LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " requestParameters != null"); method = new PostMethod(url.toExternalForm()); // "http://localhost:8080/" LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " after getting method"); //XXX method.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, false); //new way //XXX method.getParams().setIntParameter(HttpMethodParams.SO_TIMEOUT, 10000); //XXX method.getParams().setVersion(HttpVersion.HTTP_0_9); //or HttpVersion.HTTP_1_0 HttpVersion.HTTP_1_1 LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " after setting USE_EXPECT_CONTINUE"); //PostMethod is subclass of ExpectContinueMethod, so we require here: //((PostMethod)method).setUseExpectHeader(false); //client.setTimeout(30000); // increased from 10000 as temp fix; 2005-03-17 wdn5e //HttpClientParams httpClientParams = new HttpClientParams(); //httpClientParams.setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true); //old way //httpClientParams.setIntParameter(HttpMethodParams.SO_TIMEOUT, 30000); LogFactory.getLog(ConnectPubcookie.class).debug(ConnectPubcookie.class.getName() + ".setup()" + " A"); Part[] parts = new Part[requestParameters.size()]; Iterator iterator = requestParameters.keySet().iterator(); for (int i = 0; iterator.hasNext(); i++) { String fieldName = (String) iterator.next(); String fieldValue = (String) requestParameters.get(fieldName); StringPart stringPart = new StringPart(fieldName, fieldValue); parts[i] = stringPart; LogFactory.getLog(ConnectPubcookie.class).debug(ConnectPubcookie.class.getName() + ".setup()" + " part[" + i + "]==" + fieldName + "=" + fieldValue); ((PostMethod) method).addParameter(fieldName, fieldValue); //old way } LogFactory.getLog(ConnectPubcookie.class).debug(ConnectPubcookie.class.getName() + ".setup()" + " B"); //XXX MultipartRequestEntity multipartRequestEntity = new MultipartRequestEntity(parts, method.getParams()); // ((PostMethod)method).setRequestEntity(multipartRequestEntity); //new way } //method.getParams().setCookiePolicy(CookiePolicy.RFC_2109); HttpState state = client.getState(); for (Cookie cookie : requestCookies) { state.addCookie(cookie); } //method.setFollowRedirects(true); this is disallowed at runtime, so redirect won't be honored LogFactory.getLog(ConnectPubcookie.class).debug(ConnectPubcookie.class.getName() + ".setup()" + " C"); LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " method==" + method); LogFactory.getLog(ConnectPubcookie.class) .debug(ConnectPubcookie.class.getName() + ".setup()" + " method==" + method.toString()); return method; }
From source file:net.danielkvasnicka.flower.core.SpringFlowerNamespaceHandler.java
/** * @see org.springframework.beans.factory.xml.NamespaceHandler#init() *///from w w w.j a va 2 s .c o m @Override public void init() { LogFactory.getLog(this.getClass()).info("Scanning Flower URL Bindings for Spring beans"); super.registerBeanDefinitionDecoratorForAttribute("url-mapping", new FlowerURLMappingBeanDefinitionDecorator()); }
From source file:de.berlios.jedi.common.config.ConfigurationFactory.java
/** * Returns a Configuration instance.<br> * If an exception happens when creating the configuration, an empty * Configuration object is returned and the exception is logged. It * shouldn't happen, however...//from w w w .j a va 2s . co m * * @return A Configuration instance. */ public static Configuration getConfiguration() { try { return instance.getConfigurationFactory().getConfiguration(); } catch (ConfigurationException e) { LogFactory.getLog(ConfigurationFactory.class).error("Configuration can not be retrieved", e); return new BaseConfiguration(); } }
From source file:de.tudarmstadt.ukp.dkpro.core.api.datasets.Dataset.java
default Split getSplit(double aTrainRatio, double aTestRatio) { Log LOG = LogFactory.getLog(getClass()); File[] all = getDataFiles();/*from w ww . j av a2s. c o m*/ Arrays.sort(all, (File a, File b) -> { return a.getName().compareTo(b.getName()); }); LOG.info("Found " + all.length + " files"); int trainPivot = (int) Math.round(all.length * aTrainRatio); int testPivot = (int) Math.round(all.length * aTestRatio) + trainPivot; File[] train = (File[]) ArrayUtils.subarray(all, 0, trainPivot); File[] test = (File[]) ArrayUtils.subarray(all, trainPivot, testPivot); LOG.debug("Assigned " + train.length + " files to training set"); LOG.debug("Assigned " + test.length + " files to test set"); if (testPivot != all.length) { LOG.info("Files missing from split: [" + (all.length - testPivot) + "]"); } return new SplitImpl(train, test, null); }