• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LoggingApplicationListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.boot.logging.LoggingApplicationListener的典型用法代码示例。如果您正苦于以下问题:Java LoggingApplicationListener类的具体用法?Java LoggingApplicationListener怎么用?Java LoggingApplicationListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LoggingApplicationListener类属于org.springframework.boot.logging包,在下文中一共展示了LoggingApplicationListener类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    ConfigurableApplicationContext context = builder.run(args);
    LOGGER.info("collector backup start successfully");

    KafkaConsumer kafkaConsumer = (KafkaConsumer<byte[], String>) context.getBean("kafkaConsumer");
    Task task = (Task) context.getBean("backupTask");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new ShutdownHookRunner(kafkaConsumer, task));
    task.doTask();
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:21,代码来源:Launcher.java


示例2: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("hi-log-log4j2 start successfully");

    String a = "哈哈";
    while (true) {
        LOGGER.info("i am test, {}", a);
        Thread.sleep(1000);
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:21,代码来源:Launcher.java


示例3: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    ConfigurableApplicationContext context = builder.run(args);
    LOGGER.info("collector trace start successfully");

    KafkaConsumer kafkaConsumer = (KafkaConsumer<byte[], String>) context.getBean("kafkaConsumer");
    Task task = (Task) context.getBean("rpcTraceTask");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new ShutdownHookRunner(kafkaConsumer, task));
    task.doTask();
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:21,代码来源:Launcher.java


示例4: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    ConfigurableApplicationContext context = builder.run(args);
    LOGGER.info("collector indexer start successfully");

    KafkaConsumer kafkaConsumer = (KafkaConsumer<byte[], String>) context.getBean("kafkaConsumer");
    Task task = (Task) context.getBean("indexerTask");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new ShutdownHookRunner(kafkaConsumer, task));
    task.doTask();
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:21,代码来源:Launcher.java


示例5: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    ConfigurableApplicationContext context = builder.run(args);
    LOGGER.info("collector metrics start successfully");

    KafkaConsumer kafkaConsumer = (KafkaConsumer<byte[], String>) context.getBean("kafkaConsumer");
    Task task = (Task) context.getBean("metricsTask");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new ShutdownHookRunner(kafkaConsumer, task));
    task.doTask();
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:21,代码来源:Launcher.java


示例6: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("服务C start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:38,代码来源:Launcher.java


示例7: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("服务B start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:38,代码来源:Launcher.java


示例8: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("服务E start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:38,代码来源:Launcher.java


示例9: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("服务D start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:38,代码来源:Launcher.java


示例10: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("接口A start successfully");
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:15,代码来源:Application.java


示例11: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);
    LOGGER.info("alarm start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:37,代码来源:Launcher.java


示例12: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);

    LOGGER.info("web start successfully");
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:15,代码来源:Application.java


示例13: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    builder.run(args);
    LOGGER.info("monitor start successfully");

    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:37,代码来源:Launcher.java


示例14: getListeners

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
private Collection<ApplicationListener<?>> getListeners() {
	List<ApplicationListener<?>> listeners = new ArrayList<ApplicationListener<?>>();
	listeners.add(new AnsiOutputApplicationListener());
	listeners.add(new ConfigFileApplicationListener());
	listeners.add(new ClasspathLoggingApplicationListener());
	listeners.add(new LoggingApplicationListener());
	listeners.add(new RemoteUrlPropertyExtractor());
	return listeners;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:RemoteSpringApplication.java


示例15: getListeners

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
private Collection<ApplicationListener<?>> getListeners() {
	List<ApplicationListener<?>> listeners = new ArrayList<ApplicationListener<?>>();
	listeners.add(new AnsiOutputApplicationListener());
	listeners.add(new ConfigFileEnvironmentPostProcessor());
	listeners.add(new EnvironmentPostProcessingApplicationListener());
	listeners.add(new ClasspathLoggingApplicationListener());
	listeners.add(new LoggingApplicationListener());
	listeners.add(new RemoteUrlPropertyExtractor());
	return listeners;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:RemoteSpringApplication.java


示例16: buildApplication

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static SdcctApplication buildApplication() {
    ResourceLoader resourceLoader = new DefaultResourceLoader();
    ResourcePatternResolver resourcePatternResolver = ResourcePatternUtils.getResourcePatternResolver(resourceLoader);

    SdcctApplication app = ((SdcctApplication) new SdcctApplicationBuilder(buildSources(resourcePatternResolver)).addCommandLineProperties(false)
        .bannerMode(Mode.OFF).headless(true).resourceLoader(resourceLoader).application());

    app.setPropertySource(buildPropertySource(resourcePatternResolver));

    app.setListeners(
        app.getListeners().stream().filter((appListener -> !appListener.getClass().equals(LoggingApplicationListener.class))).collect(Collectors.toList()));

    return app;
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:15,代码来源:SdcctApplicationConfiguration.java


示例17: buildApplication

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static CrigttApplication buildApplication() {
    ResourceLoader resourceLoader = new DefaultResourceLoader();

    CrigttApplication app =
        ((CrigttApplication) new CrigttApplicationBuilder(buildApplicationSources(resourceLoader)).addCommandLineProperties(false).showBanner(false)
            .headless(true).resourceLoader(resourceLoader).application());
    app.setListeners(app.getListeners().stream().filter((appListener -> !appListener.getClass().equals(LoggingApplicationListener.class)))
        .collect(Collectors.toList()));

    return app;
}
 
开发者ID:esacinc,项目名称:crigtt,代码行数:12,代码来源:CrigttApplicationConfiguration.java


示例18: getOrder

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
@Override
public int getOrder() {
    return LoggingApplicationListener.DEFAULT_ORDER - 1;
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:5,代码来源:LoggingFileOverrideListener.java


示例19: main

import org.springframework.boot.logging.LoggingApplicationListener; //导入依赖的package包/类
public static void main(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(Launcher.class);
    Set<ApplicationListener<?>> listeners = builder.application().getListeners();
    for (Iterator<ApplicationListener<?>> it = listeners.iterator(); it.hasNext();) {
        ApplicationListener<?> listener = it.next();
        if (listener instanceof LoggingApplicationListener) {
            it.remove();
        }
    }
    builder.application().setListeners(listeners);
    ConfigurableApplicationContext context = builder.run(args);
    LOGGER.info("log-generator start successfully");

    GenerateLogService logService = context.getBean(GenerateLogService.class);
    logService.generateCoverLog();



    // 优雅停止项目
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            LOGGER.info("try to stop the system");
            synchronized (Launcher.class) {
                RUNNING = false;
                Launcher.class.notify();
            }
        }
    });

    synchronized (Launcher.class) {
        while (RUNNING) {
            try {
                Launcher.class.wait();
            } catch (InterruptedException e) {
                LOGGER.error("wait error");
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:JThink,项目名称:SkyEye,代码行数:42,代码来源:Launcher.java



注:本文中的org.springframework.boot.logging.LoggingApplicationListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TypeIdItem类代码示例发布时间:2022-05-22
下一篇:
Java GetJournalCTimeRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap