Search in sources :

Example 1 with RemoteLogger

use of com.codingchili.core.logging.RemoteLogger in project chili-core by codingchili.

the class ListenerExceptionLogger method create.

/**
 * @param core     the core context.
 * @param listener the listener that the logger is created for.
 * @param handler  the handler that is attached to the listener.
 * @return a logger with metadata which includes information about the handler/listener.
 */
public static Logger create(CoreContext core, CoreListener listener, CoreHandler handler) {
    Logger logger = new RemoteLogger(core, handler.getClass());
    logger.setMetadataValue(LOG_LISTENER, listener.getClass()::getSimpleName);
    return logger;
}
Also used : RemoteLogger(com.codingchili.core.logging.RemoteLogger) Logger(com.codingchili.core.logging.Logger) RemoteLogger(com.codingchili.core.logging.RemoteLogger)

Example 2 with RemoteLogger

use of com.codingchili.core.logging.RemoteLogger in project chili-core by codingchili.

the class SystemContext method initialize.

private void initialize() {
    this.logger = new RemoteLogger(this, SystemContext.class);
    // add a shutdown hook for gracefully shutting down the context.
    ShutdownHook.register(this);
    vertx.exceptionHandler(throwable -> logger.onError(throwable));
    if (!initialized.get()) {
        this.metrics = new MetricCollector(this, Configurations.system().getMetrics(), MetricSettings.REGISTRY_NAME);
        StartupListener.publish(this);
        initialized.set(true);
    }
}
Also used : MetricCollector(com.codingchili.core.metrics.MetricCollector) RemoteLogger(com.codingchili.core.logging.RemoteLogger)

Aggregations

RemoteLogger (com.codingchili.core.logging.RemoteLogger)2 Logger (com.codingchili.core.logging.Logger)1 MetricCollector (com.codingchili.core.metrics.MetricCollector)1