@Override public Statement apply(Statement base, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { vertx = createVertx.get(); try { Context context = vertx != null ? vertx.getOrCreateContext() : null; VertxUnitRunner.pushContext(context); base.evaluate(); } finally { VertxUnitRunner.popContext(); CountDownLatch latch = new CountDownLatch(1); closeVertx.accept(vertx, latch); try { if (!latch.await(30 * 1000, TimeUnit.MILLISECONDS)) { Logger logger = LoggerFactory.getLogger(description.getTestClass()); logger.warn("Could not close Vert.x in tme"); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } }; }
public VolumeV1(Path path) { this.basePath = path; this.metaFilePath = metaFilePath(basePath); this.dataFilePath = dataFilePath(basePath); this.indexFilePath = indexFilePath(basePath); logger = LoggerFactory.getLogger(VolumeV1.class.getName() + "." + join(basePath)); gcLogger = LoggerFactory.getLogger(VolumeV1.class.getName() + "." + join(basePath) + ".gc"); }
public LoggingAppender(final LoggingAppenderOptions appenderOptions, final Collection<AccessLogElement> accessLogElements){ if(appenderOptions == null){ throw new IllegalArgumentException("appenderOptions must not be null"); } if(accessLogElements == null || accessLogElements.size() < 1){ throw new IllegalArgumentException("accessLogElements must contain at least one element"); } this.logger = LoggerFactory.getLogger(appenderOptions.getLoggerName()); this.accessLogElements = accessLogElements; }
public ConfigurationProvider(ConfigStore store, ConfigProcessor processor, JsonObject config, boolean optional) { this.store = store; this.processor = processor; this.optional = optional; if (config == null) { this.configuration = new JsonObject(); } else { this.configuration = config; } this.logger = LoggerFactory.getLogger("ConfigurationProvider#" + store); }
/** * Initialize the logback logger and ensure that the logback file is placed in the config folder */ public static void init() { File logbackFile = new File("config", "logback.xml"); if (!logbackFile.exists()) { writeFile(logbackFile); } System.setProperty("logback.configurationFile", logbackFile.getAbsolutePath()); System.setProperty(LoggerFactory.LOGGER_DELEGATE_FACTORY_CLASS_NAME, SLF4JLogDelegateFactory.class.getName()); LoggerFactory.getLogger(LoggingConfigurator.class); }
protected Logger getLogger() { return LoggerFactory.getLogger(getClass()); }
public Log4JAnnal(final Class<?> clazz) { this.logger = LoggerFactory.getLogger(clazz); }
public VerticleHelper(Class clazz) { this.logger = LoggerFactory.getLogger(clazz); }
public static Logger get() { System.setProperty("vertx.logger-delegate-factory-class-name", "io.vertx.core.logging.SLF4JLogDelegateFactory"); return LoggerFactory.getLogger("okapi"); }
public static void main(String[] args) throws Exception { LoggingConfigurator.init(); log = LoggerFactory.getLogger(DemoRunner.class); // Extract dump file on first time startup to speedup startup setupDemo(); MeshOptions options = OptionsLoader.createOrloadOptions(args); // For Mesh UI Dev // options.getHttpServerOptions().setEnableCors(true); // options.getHttpServerOptions().setCorsAllowCredentials(true); // options.getHttpServerOptions().setCorsAllowedOriginPattern("http://localhost:5000"); // options.getSearchOptions().setHttpEnabled(true); // options.getStorageOptions().setStartServer(true); // options.getSearchOptions().setHttpEnabled(true); // options.getStorageOptions().setDirectory(null); // options.setClusterMode(true); Mesh mesh = Mesh.mesh(options); mesh.setCustomLoader((vertx) -> { JsonObject config = new JsonObject(); config.put("port", options.getHttpServerOptions().getPort()); MeshComponent meshInternal = MeshInternal.get(); EndpointRegistry registry = meshInternal.endpointRegistry(); // Add demo content provider registry.register(DemoAppEndpoint.class); DemoDataProvider data = new DemoDataProvider(meshInternal.database(), meshInternal.meshLocalClientImpl(), meshInternal.boot()); DemoVerticle demoVerticle = new DemoVerticle(data); DeploymentUtil.deployAndWait(vertx, config, demoVerticle, false); // Add admin ui registry.register(AdminGUIEndpoint.class); // // Add elastichead // if (options.getSearchOptions().isHttpEnabled()) { // registry.register(ElasticsearchHeadEndpoint.class); // } }); mesh.run(); }
public SlaveRunner() { super(); logger = LoggerFactory.getLogger(getClass()); }
public MasterRunner() { super(); logger = LoggerFactory.getLogger(getClass()); }
public AbstractRunner() { vertx = Vertx.vertx(); System.setProperty("vertx.logger-delegate-factory-class-name", "io.vertx.core.logging.SLF4JLogDelegateFactory"); logger = LoggerFactory.getLogger(getClass()); }
@Override public Log getLog(Class clazz) { return new JGroupsLoggerAdapter(LoggerFactory.getLogger(clazz)); }
@Override public Log getLog(String category) { return new JGroupsLoggerAdapter(LoggerFactory.getLogger(category)); }
LogManager(String prefix, Class<?> clazz) { _logger = LoggerFactory.getLogger(LinkManager.class); _prefix = prefix; }
public LogSinkStream() { logger = LoggerFactory.getLogger(configObj.getString("name", "default_log")); }
@Override public IApimanLogger createLogger(String name) { return new VertxApimanLogger(LoggerFactory.getLogger(name)); }
@Override public IApimanLogger createLogger(Class<?> klazz) { return new VertxApimanLogger(LoggerFactory.getLogger(klazz)); }