org.apache.log4j.component.helpers.MessageFormatter Java Examples

The following examples show how to use org.apache.log4j.component.helpers.MessageFormatter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MetricsUploadAppenderPrescriber.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Upload file.
 * 
 * @param compressed
 *            the compressed
 * @throws IntegrationModuleException
 *             the integration module exception {@inheritDoc}
 */
@Override
public void uploadFile(byte[] compressed) throws Exception {
	PropertyHandler propertyHandler = PropertyHandler.getInstance();
	String nihii;
	try{
		nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
	} catch (Throwable t) {
		LOG.warn("Nihii in session not found: ", t);
		nihii = propertyHandler.getProperty("metrics.select.nihii");
		LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
	}
	boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
	String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
	if (metricsFilteringEnabled) {
		if (nihii.endsWith(groupOfNihiiEnabled)) {
			uploadMetrics(compressed);
		} else {
			LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
		}
	} else {
		uploadMetrics(compressed);
	}
}
 
Example #2
Source File: MetricsUploadAppenderExecutor.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Upload file.
 * 
 * @param compressed the compressed
    * @throws be.apb.gfddpp.common.exceptions.GFDDPPException
 * @throws IntegrationModuleException the integration module exception
 * {@inheritDoc}
 */
@Override
public void uploadFile(byte[] compressed) throws Exception {
	PropertyHandler propertyHandler = PropertyHandler.getInstance();
	String nihii;
	try{
		nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
	} catch (Throwable t) {
		LOG.warn("Nihii in session not found: ", t);
		nihii = propertyHandler.getProperty("metrics.select.nihii");
		LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
	}
	boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
	String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
	if (metricsFilteringEnabled) {
		if (nihii.endsWith(groupOfNihiiEnabled)) {
			uploadMetrics(compressed);
		} else {
			LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
		}
	} else {
		LOG.debug("Metrics Upload is disabled.");
	}
}
 
Example #3
Source File: MetricsUploadAppenderPrescriber.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public void uploadFile(byte[] compressed) throws Exception {
   PropertyHandler propertyHandler = PropertyHandler.getInstance();

   String nihii;
   try {
      nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
   } catch (Throwable var6) {
      LOG.warn("Nihii in session not found: ", var6);
      nihii = propertyHandler.getProperty("metrics.select.nihii");
      LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
   }

   boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
   String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
   if (metricsFilteringEnabled) {
      if (nihii.endsWith(groupOfNihiiEnabled)) {
         this.uploadMetrics(compressed);
      } else {
         LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
      }
   } else {
      this.uploadMetrics(compressed);
   }

}
 
Example #4
Source File: MetricsUploadAppenderExecutor.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public void uploadFile(byte[] compressed) throws Exception {
   PropertyHandler propertyHandler = PropertyHandler.getInstance();

   String nihii;
   try {
      nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
   } catch (Throwable var6) {
      LOG.warn("Nihii in session not found: ", var6);
      nihii = propertyHandler.getProperty("metrics.select.nihii");
      LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
   }

   boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
   String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
   if (metricsFilteringEnabled) {
      if (nihii.endsWith(groupOfNihiiEnabled)) {
         this.uploadMetrics(compressed);
      } else {
         LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
      }
   } else {
      LOG.debug("Metrics Upload is disabled.");
   }

}
 
Example #5
Source File: MetricsUploadAppenderPrescriber.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Upload file.
 * 
 * @param compressed
 *            the compressed
 * @throws IntegrationModuleException
 *             the integration module exception {@inheritDoc}
 */
@Override
public void uploadFile(byte[] compressed) throws Exception {
	PropertyHandler propertyHandler = PropertyHandler.getInstance();
	String nihii;
	try{
		nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
	} catch (Throwable t) {
		LOG.warn("Nihii in session not found: ", t);
		nihii = propertyHandler.getProperty("metrics.select.nihii");
		LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
	}
	boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
	String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
	if (metricsFilteringEnabled) {
		if (nihii.endsWith(groupOfNihiiEnabled)) {
			uploadMetrics(compressed);
		} else {
			LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
		}
	} else {
		uploadMetrics(compressed);
	}
}
 
Example #6
Source File: MetricsUploadAppenderExecutor.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Upload file.
 * 
 * @param compressed the compressed
    * @throws be.apb.gfddpp.common.exceptions.GFDDPPException
 * @throws IntegrationModuleException the integration module exception
 * {@inheritDoc}
 */
@Override
public void uploadFile(byte[] compressed) throws Exception {
	PropertyHandler propertyHandler = PropertyHandler.getInstance();
	String nihii;
	try{
		nihii = STSHelper.getNihii(Session.getInstance().getSession().getSAMLToken().getAssertion());
	} catch (Throwable t) {
		LOG.warn("Nihii in session not found: ", t);
		nihii = propertyHandler.getProperty("metrics.select.nihii");
		LOG.debug("NIHII found in proerperty file is [" + nihii + "]");
	}
	boolean metricsFilteringEnabled = Boolean.parseBoolean(propertyHandler.getProperty("metrics.select.nihii.enable", "false"));
	String groupOfNihiiEnabled = propertyHandler.getProperty("metrics.select.nihii.group");
	if (metricsFilteringEnabled) {
		if (nihii.endsWith(groupOfNihiiEnabled)) {
			uploadMetrics(compressed);
		} else {
			LOG.debug(MessageFormatter.format("Info will not be logged because the nihii {} does not ends up with {}", nihii, groupOfNihiiEnabled));
		}
	} else {
		LOG.debug("Metrics Upload is disabled.");
	}
}
 
Example #7
Source File: ITJDBCResourceStoreTest.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Test
public void testMsgFormatter() {
    System.out.println(MessageFormatter.format("{}:{}", "a", "b"));
}
 
Example #8
Source File: ITJDBCResourceStoreTest.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Test
public void testMsgFormatter() {
    System.out.println(MessageFormatter.format("{}:{}", "a", "b"));
}