下面列出了怎么用org.apache.log4j.component.helpers.MessageFormatter的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* 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);
}
}
/**
* 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.");
}
}
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);
}
}
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.");
}
}
/**
* 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);
}
}
/**
* 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.");
}
}
@Test
public void testMsgFormatter() {
System.out.println(MessageFormatter.format("{}:{}", "a", "b"));
}
@Test
public void testMsgFormatter() {
System.out.println(MessageFormatter.format("{}:{}", "a", "b"));
}