Search in sources :

Example 6 with LoggingTester

use of co.cask.cdap.logging.appender.LoggingTester in project cdap by caskdata.

the class TestKafkaLogging method init.

@BeforeClass
public static void init() throws Exception {
    txManager = KAFKA_TESTER.getInjector().getInstance(TransactionManager.class);
    txManager.startAndWait();
    KafkaLogAppender appender = KAFKA_TESTER.getInjector().getInstance(KafkaLogAppender.class);
    new LogAppenderInitializer(appender).initialize("TestKafkaLogging");
    Logger logger = LoggerFactory.getLogger("TestKafkaLogging");
    LoggingTester loggingTester = new LoggingTester();
    loggingTester.generateLogs(logger, new FlowletLoggingContext("TKL_NS_1", "APP_1", "FLOW_1", "FLOWLET_1", "RUN1", "INSTANCE1"));
    appender.stop();
}
Also used : LoggingTester(co.cask.cdap.logging.appender.LoggingTester) LogAppenderInitializer(co.cask.cdap.logging.appender.LogAppenderInitializer) TransactionManager(org.apache.tephra.TransactionManager) Logger(org.slf4j.Logger) FlowletLoggingContext(co.cask.cdap.logging.context.FlowletLoggingContext) BeforeClass(org.junit.BeforeClass)

Aggregations

LoggingTester (co.cask.cdap.logging.appender.LoggingTester)6 FlowletLoggingContext (co.cask.cdap.logging.context.FlowletLoggingContext)6 LoggingContext (co.cask.cdap.common.logging.LoggingContext)4 Test (org.junit.Test)4 LogAppenderInitializer (co.cask.cdap.logging.appender.LogAppenderInitializer)2 FileLogReader (co.cask.cdap.logging.read.FileLogReader)2 KafkaLogReader (co.cask.cdap.logging.read.KafkaLogReader)2 TransactionManager (org.apache.tephra.TransactionManager)2 BeforeClass (org.junit.BeforeClass)2 Logger (org.slf4j.Logger)2 MetricsCollectionService (co.cask.cdap.api.metrics.MetricsCollectionService)1 CConfiguration (co.cask.cdap.common.conf.CConfiguration)1 ConfigModule (co.cask.cdap.common.guice.ConfigModule)1 NonCustomLocationUnitTestModule (co.cask.cdap.common.guice.NonCustomLocationUnitTestModule)1 NoOpMetricsCollectionService (co.cask.cdap.common.metrics.NoOpMetricsCollectionService)1 NamespaceQueryAdmin (co.cask.cdap.common.namespace.NamespaceQueryAdmin)1 SimpleNamespaceQueryAdmin (co.cask.cdap.common.namespace.SimpleNamespaceQueryAdmin)1 DataSetsModules (co.cask.cdap.data.runtime.DataSetsModules)1 SystemDatasetRuntimeModule (co.cask.cdap.data.runtime.SystemDatasetRuntimeModule)1 LoggingConfiguration (co.cask.cdap.logging.LoggingConfiguration)1