use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class GetAgreementsTests method main.
public static void main(String... args) throws Exception {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
// condense test cases
// read datasets (input and expected output)
// modify input, removing graphs and triples until the test breaks
String outputPath = "src/test/resources/won/utils/agreement/condensed/";
String inputPath = "src/test/resources/won/utils/agreement/input/";
Stream<Path> resources = Files.list(Paths.get(inputPath));
resources.forEach(resource -> {
try {
System.out.println("trying to condense: " + resource.toAbsolutePath().toString());
condenseTestCaseByQuery(resource, outputPath);
} catch (Exception e) {
e.printStackTrace();
}
});
}
use of ch.qos.logback.classic.Logger in project webofneeds by researchstudio-sat.
the class GetAgreementsTests method setLogLevel.
@BeforeClass
public static void setLogLevel() {
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.INFO);
}
use of ch.qos.logback.classic.Logger in project coffeenet-starter by coffeenet.
the class CoffeeNetLoggingAutoConfigurationDevelopmentFileGelfTest method integration.
@Test
public void integration() {
final Logger logger = (Logger) LoggerFactory.getLogger(ROOT_LOGGER_NAME);
assertThat(logger.getAppender("CONSOLE"), is(nullValue()));
assertThat(logger.getAppender("COFFEENET-FILE"), is(instanceOf(RollingFileAppender.class)));
assertThat(logger.getAppender("COFFEENET-GELF"), is(instanceOf(GelfAppender.class)));
}
use of ch.qos.logback.classic.Logger in project coffeenet-starter by coffeenet.
the class CoffeeNetLoggingAutoConfigurationIntegrationOnlyConsoleTest method integration.
@Test
public void integration() {
final Logger logger = (Logger) LoggerFactory.getLogger(ROOT_LOGGER_NAME);
assertThat(logger.getAppender("CONSOLE"), is(instanceOf(ConsoleAppender.class)));
assertThat(logger.getAppender("COFFEENET-FILE"), is(nullValue()));
assertThat(logger.getAppender("COFFEENET-GELF"), is(nullValue()));
}
use of ch.qos.logback.classic.Logger in project coffeenet-starter by coffeenet.
the class CoffeeNetLoggingAutoConfigurationTest method integration.
@Test
public void integration() {
final Logger logger = (Logger) LoggerFactory.getLogger(ROOT_LOGGER_NAME);
assertThat(logger.getAppender("CONSOLE"), is(instanceOf(ConsoleAppender.class)));
Appender<ILoggingEvent> fileAppender = logger.getAppender("COFFEENET-FILE");
assertThat(fileAppender, is(instanceOf(RollingFileAppender.class)));
// Check File Appender
RollingFileAppender rollingFileAppender = (RollingFileAppender) fileAppender;
assertThat(rollingFileAppender.getFile(), is("logs/app.log"));
assertThat(rollingFileAppender.getName(), is("COFFEENET-FILE"));
RollingPolicy rollingPolicy = rollingFileAppender.getRollingPolicy();
assertThat(rollingPolicy, is(instanceOf(TimeBasedRollingPolicy.class)));
TimeBasedRollingPolicy timeBasedRollingPolicy = (TimeBasedRollingPolicy) rollingFileAppender.getRollingPolicy();
assertThat(timeBasedRollingPolicy.getFileNamePattern(), is("logs/app-%d{yyyy-MM-dd}.log"));
PatternLayoutEncoder encoder = (PatternLayoutEncoder) rollingFileAppender.getEncoder();
assertThat(encoder.getPattern(), is("%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%t] %-40.40logger{39} : %m%n%wEx"));
// Check Gelf Appender
Appender<ILoggingEvent> gelfAppender = logger.getAppender("COFFEENET-GELF");
assertThat(gelfAppender, is(instanceOf(GelfAppender.class)));
GelfAppender gelfAppender1 = (GelfAppender) gelfAppender;
assertThat(gelfAppender1.getName(), is("COFFEENET-GELF"));
assertThat(gelfAppender1.getServer(), is("localServer"));
assertThat(gelfAppender1.getProtocol(), is("TCP"));
assertThat(gelfAppender1.getPort(), is(1337));
assertThat(((PatternLayout) gelfAppender1.getLayout()).getPattern(), is("%m"));
assertThat(gelfAppender1.getAdditionalFields(), hasEntry("environment", "test"));
assertThat(gelfAppender1.getAdditionalFields(), hasEntry("application", "CoffeeNetApplication"));
}
Aggregations