use of org.apache.qpid.server.logging.logback.LoggerNameAndLevelFilter in project qpid-broker-j by apache.
the class BrokerNameAndLevelLogInclusionRuleTest method testLevelChangeAffectsFilter.
public void testLevelChangeAffectsFilter() {
BrokerNameAndLevelLogInclusionRule<?> rule = createRule("org.apache.qpid", LogLevel.INFO);
LoggerNameAndLevelFilter filter = (LoggerNameAndLevelFilter) rule.asFilter();
assertEquals("Unexpected log level", Level.INFO, filter.getLevel());
rule.setAttributes(Collections.<String, Object>singletonMap("level", LogLevel.DEBUG));
assertEquals("Unexpected log level attribute", Level.DEBUG, filter.getLevel());
}
use of org.apache.qpid.server.logging.logback.LoggerNameAndLevelFilter in project qpid-broker-j by apache.
the class VirtualHostNameAndLevelLogInclusionRuleImplTest method testLoggerNameChangeNotAllowed.
public void testLoggerNameChangeNotAllowed() {
VirtualHostNameAndLevelLogInclusionRule<?> rule = createRule("org.apache.qpid", LogLevel.INFO);
LoggerNameAndLevelFilter filter = (LoggerNameAndLevelFilter) rule.asFilter();
assertEquals("Unexpected logger name", "org.apache.qpid", filter.getLoggerName());
try {
rule.setAttributes(Collections.<String, Object>singletonMap(BrokerNameAndLevelLogInclusionRule.LOGGER_NAME, "org.apache.qpid.foo"));
fail("IllegalConfigurationException is expected to throw on attempt to change logger name");
} catch (IllegalConfigurationException e) {
// pass
}
assertEquals("Unexpected logger name", "org.apache.qpid", filter.getLoggerName());
}
use of org.apache.qpid.server.logging.logback.LoggerNameAndLevelFilter in project qpid-broker-j by apache.
the class VirtualHostNameAndLevelLogInclusionRuleImplTest method testAsFilter.
public void testAsFilter() {
VirtualHostNameAndLevelLogInclusionRule<?> rule = createRule("org.apache.qpid", LogLevel.INFO);
Filter<ILoggingEvent> filter = rule.asFilter();
assertTrue("Unexpected filter instance", filter instanceof LoggerNameAndLevelFilter);
LoggerNameAndLevelFilter f = (LoggerNameAndLevelFilter) filter;
assertEquals("Unexpected log level", Level.INFO, f.getLevel());
assertEquals("Unexpected logger name", "org.apache.qpid", f.getLoggerName());
}
use of org.apache.qpid.server.logging.logback.LoggerNameAndLevelFilter in project qpid-broker-j by apache.
the class BrokerNameAndLevelLogInclusionRuleTest method testAsFilter.
public void testAsFilter() {
BrokerNameAndLevelLogInclusionRule<?> rule = createRule("org.apache.qpid", LogLevel.INFO);
Filter<ILoggingEvent> filter = rule.asFilter();
assertTrue("Unexpected filter instance", filter instanceof LoggerNameAndLevelFilter);
LoggerNameAndLevelFilter f = (LoggerNameAndLevelFilter) filter;
assertEquals("Unexpected log level", Level.INFO, f.getLevel());
assertEquals("Unexpected logger name", "org.apache.qpid", f.getLoggerName());
}
use of org.apache.qpid.server.logging.logback.LoggerNameAndLevelFilter in project qpid-broker-j by apache.
the class BrokerNameAndLevelLogInclusionRuleTest method testLoggerNameChangeNotAllowed.
public void testLoggerNameChangeNotAllowed() {
BrokerNameAndLevelLogInclusionRule<?> rule = createRule("org.apache.qpid", LogLevel.INFO);
LoggerNameAndLevelFilter filter = (LoggerNameAndLevelFilter) rule.asFilter();
assertEquals("Unexpected logger name", "org.apache.qpid", filter.getLoggerName());
try {
rule.setAttributes(Collections.<String, Object>singletonMap(BrokerNameAndLevelLogInclusionRule.LOGGER_NAME, "org.apache.qpid.foo"));
fail("IllegalConfigurationException is expected to throw on attempt to change logger name");
} catch (IllegalConfigurationException e) {
// pass
}
assertEquals("Unexpected logger name", "org.apache.qpid", filter.getLoggerName());
}
Aggregations