io.vertx.core.logging.LoggerFactory Java Examples

The following examples show how to use io.vertx.core.logging.LoggerFactory. 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: Runner.java    From vxms with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {
    // Use logback for logging
    File logbackFile = new File("config", "logback.xml");
    System.setProperty("logback.configurationFile", logbackFile.getAbsolutePath());
    System.setProperty(LoggerFactory.LOGGER_DELEGATE_FACTORY_CLASS_NAME, SLF4JLogDelegateFactory.class.getName());
    Logger log = LoggerFactory.getLogger(Runner.class);

    // Setup the http server
    log.info("Starting server for: http://localhost:8080/hello");
    Vertx vertx = Vertx.vertx();
    Router router = Router.router(vertx);

    router.route("/hello").handler(rc -> {
        log.info("Got hello request");
        rc.response().end("World");
    });

    vertx.createHttpServer()
            .requestHandler(router::accept)
            .listen(8080);

}
 
Example #2
Source File: LauncherUtils.java    From konduit-serving with Apache License 2.0 5 votes vote down vote up
/**
 * This sets some of the common properties for vertx and logs. This will set the working directory
 * for vertx and channels the vertx related logs to the logback configuration that konduit-serving
 * utilizes.
 */
public static void setCommonLoggingAndVertxProperties() {
    setProperty(LOGGER_DELEGATE_FACTORY_CLASS_NAME, SLF4JLogDelegateFactory.class.getName());
    LoggerFactory.getLogger(LoggerFactory.class); // Required for Logback to work in Vertx

    setProperty("vertx.cwd", DirectoryFetcher.getWorkingDir().getAbsolutePath()); // For setting the vertx working directory for runtime files.
    setProperty(CACHE_DIR_BASE_PROP_NAME, DirectoryFetcher.getWorkingDir().getAbsolutePath()); // For setting caching directory for vertx related optimizations.
}
 
Example #3
Source File: VolumeV1.java    From sfs with Apache License 2.0 5 votes vote down vote up
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");
}
 
Example #4
Source File: OrionLoggerHandler.java    From orion with Apache License 2.0 4 votes vote down vote up
public OrionLoggerHandler() {
  super(LoggerFormat.DEFAULT);
  this.logger = LoggerFactory.getLogger(this.getClass());
}
 
Example #5
Source File: VerticleHelper.java    From vertx-swagger with Apache License 2.0 4 votes vote down vote up
public VerticleHelper(Class clazz) {
    this.logger = LoggerFactory.getLogger(clazz);
}
 
Example #6
Source File: VerticleHelper.java    From vertx-swagger with Apache License 2.0 4 votes vote down vote up
public VerticleHelper(Class clazz) {
    this.logger = LoggerFactory.getLogger(clazz);
}
 
Example #7
Source File: VerticleHelper.java    From vertx-swagger with Apache License 2.0 4 votes vote down vote up
public VerticleHelper(Class clazz) {
    this.logger = LoggerFactory.getLogger(clazz);
}
 
Example #8
Source File: VerticleHelper.java    From vertx-swagger with Apache License 2.0 4 votes vote down vote up
public VerticleHelper(Class clazz) {
    this.logger = LoggerFactory.getLogger(clazz);
}
 
Example #9
Source File: VertxLoggerDelegate.java    From apiman with Apache License 2.0 4 votes vote down vote up
@Override
public IApimanLogger createLogger(String name) {
    return new VertxApimanLogger(LoggerFactory.getLogger(name));
}
 
Example #10
Source File: VertxLoggerDelegate.java    From apiman with Apache License 2.0 4 votes vote down vote up
@Override
public IApimanLogger createLogger(Class<?> klazz) {
    return new VertxApimanLogger(LoggerFactory.getLogger(klazz));
}