akka.event.Logging Java Examples

The following examples show how to use akka.event.Logging. 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: WebSocketRoute.java    From ditto with Eclipse Public License 2.0 6 votes vote down vote up
private Flow<Message, String, NotUsed> getStrictifyFlow(final HttpRequest request,
        final CharSequence correlationId) {
    return Flow.<Message>create()
            .via(Flow.fromFunction(msg -> {
                IN_COUNTER.increment();
                return msg;
            }))
            .filter(Message::isText)
            .map(Message::asTextMessage)
            .map(textMsg -> {
                if (textMsg.isStrict()) {
                    return Source.single(textMsg.getStrictText());
                } else {
                    return textMsg.getStreamedText();
                }
            })
            .flatMapConcat(textMsg -> textMsg.fold("", (str1, str2) -> str1 + str2))
            .via(incomingMessageSniffer.toAsyncFlow(request))
            .via(Flow.fromFunction(result -> {
                LOGGER.withCorrelationId(correlationId).debug("Received incoming WebSocket message: {}", result);
                return result;
            }))
            .withAttributes(Attributes.createLogLevels(Logging.DebugLevel(), Logging.DebugLevel(),
                    Logging.WarningLevel()));

}
 
Example #2
Source File: SearchRootActor.java    From ditto with Eclipse Public License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
private SearchRootActor(final SearchConfig searchConfig, final ActorRef pubSubMediator,
        final ActorMaterializer materializer) {

    log = Logging.getLogger(getContext().system(), this);

    final MongoDbConfig mongoDbConfig = searchConfig.getMongoDbConfig();
    final MongoDbConfig.MonitoringConfig monitoringConfig = mongoDbConfig.getMonitoringConfig();

    final DittoMongoClient mongoDbClient = MongoClientWrapper.getBuilder(mongoDbConfig)
            .addCommandListener(getCommandListenerOrNull(monitoringConfig))
            .addConnectionPoolListener(getConnectionPoolListenerOrNull(monitoringConfig))
            .build();

    final ThingsSearchPersistence thingsSearchPersistence = getThingsSearchPersistence(searchConfig, mongoDbClient);
    final ActorRef searchActor = initializeSearchActor(searchConfig.getLimitsConfig(), thingsSearchPersistence);
    pubSubMediator.tell(DistPubSubAccess.put(searchActor), getSelf());

    final TimestampPersistence backgroundSyncPersistence =
            MongoTimestampPersistence.initializedInstance(BACKGROUND_SYNC_COLLECTION_NAME, mongoDbClient,
                    materializer);

    final ActorRef searchUpdaterRootActor = startChildActor(SearchUpdaterRootActor.ACTOR_NAME,
            SearchUpdaterRootActor.props(searchConfig, pubSubMediator, materializer, thingsSearchPersistence,
                    backgroundSyncPersistence));
    final ActorRef healthCheckingActor = initializeHealthCheckActor(searchConfig, searchUpdaterRootActor);

    createHealthCheckingActorHttpBinding(searchConfig.getHttpConfig(), healthCheckingActor, materializer);
}
 
Example #3
Source File: MongoThingsSearchPersistence.java    From ditto with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Initializes the things search persistence with a passed in {@code persistence}.
 *
 * @param mongoClient the mongoDB persistence wrapper.
 * @param actorSystem the Akka ActorSystem.
 * @since 1.0.0
 */
public MongoThingsSearchPersistence(final DittoMongoClient mongoClient, final ActorSystem actorSystem) {
    final MongoDatabase database = mongoClient.getDefaultDatabase();
    // configure search persistence to stress the primary as little as possible and tolerate inconsistency
    collection = database
            .getCollection(PersistenceConstants.THINGS_COLLECTION_NAME)
            .withReadPreference(ReadPreference.secondaryPreferred());

    log = Logging.getLogger(actorSystem, getClass());
    final ActorMaterializer materializer = ActorMaterializer.create(actorSystem);
    indexInitializer = IndexInitializer.of(database, materializer);
    maxQueryTime = mongoClient.getDittoSettings().getMaxQueryTime();
    hints = MongoHints.empty();
}
 
Example #4
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #5
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #6
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #7
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #8
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #9
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #10
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #11
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #12
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #13
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #14
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #15
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #16
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #17
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #18
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #19
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #20
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #21
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #22
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #23
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #24
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #25
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #26
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}
 
Example #27
Source File: CoffeeHouseApp.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public CoffeeHouseApp(final ActorSystem system) {
    this.system = system;
    log = Logging.getLogger(system, getClass().getName());
    coffeeHouse = createCoffeeHouse();
}
 
Example #28
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptErrorLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Error.class, pattern, occurrences, i);
}
 
Example #29
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptDebugLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Debug.class, pattern, occurrences, i);
}
 
Example #30
Source File: BaseAkkaTestCase.java    From oreilly-reactive-architecture-student with Apache License 2.0 4 votes vote down vote up
public void interceptInfoLogMessage(JavaTestKit kit, String pattern, int occurrences, final CodeUnderInspection i) {
    eventFilter(kit, Logging.Info.class, pattern, occurrences, i);
}