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;
}
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);
}
}
Aggregations