org.slf4j.Logger.getName()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(357)

本文整理了Java中org.slf4j.Logger.getName()方法的一些代码示例,展示了Logger.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.getName()方法的具体详情如下:
包路径:org.slf4j.Logger
类名称:Logger
方法名:getName

Logger.getName介绍

[英]Return the name of this Logger instance.
[中]返回此Logger实例的名称。

代码示例

代码示例来源:origin: spring-projects/spring-framework

  1. public Slf4jLog(T logger) {
  2. this.name = logger.getName();
  3. this.logger = logger;
  4. }

代码示例来源:origin: netty/netty

  1. Slf4JLogger(Logger logger) {
  2. super(logger.getName());
  3. this.logger = logger;
  4. }

代码示例来源:origin: alibaba/druid

  1. public void setDataSourceLogger(Logger dataSourceLogger) {
  2. this.dataSourceLogger = dataSourceLogger;
  3. this.dataSourceLoggerName = dataSourceLogger.getName();
  4. }

代码示例来源:origin: alibaba/druid

  1. public void setConnectionLogger(Logger connectionLogger) {
  2. this.connectionLogger = connectionLogger;
  3. this.connectionLoggerName = connectionLogger.getName();
  4. }

代码示例来源:origin: alibaba/druid

  1. public void setStatementLogger(Logger statementLogger) {
  2. this.statementLogger = statementLogger;
  3. this.statementLoggerName = statementLogger.getName();
  4. }

代码示例来源:origin: alibaba/druid

  1. public void setResultSetLogger(Logger resultSetLogger) {
  2. this.resultSetLogger = resultSetLogger;
  3. this.resultSetLoggerName = resultSetLogger.getName();
  4. }

代码示例来源:origin: apache/kafka

  1. @Override
  2. public String getName() {
  3. return logger.getName();
  4. }

代码示例来源:origin: redisson/redisson

  1. Slf4JLogger(Logger logger) {
  2. super(logger.getName());
  3. this.logger = logger;
  4. }

代码示例来源:origin: apache/rocketmq

  1. @Override
  2. public String getName() {
  3. return logger.getName();
  4. }

代码示例来源:origin: org.slf4j/jcl-over-slf4j

  1. SLF4JLog(Logger logger) {
  2. this.logger = logger;
  3. this.name = logger.getName();
  4. }

代码示例来源:origin: Alluxio/alluxio

  1. @Override
  2. public String getName() {
  3. return mDelegate.getName();
  4. }

代码示例来源:origin: redisson/redisson

  1. @Override
  2. public String toString() {
  3. return super.toString()+"{logger="+log.getName()+"}";
  4. }
  5. }

代码示例来源:origin: apache/incubator-druid

  1. @Override
  2. public String toString()
  3. {
  4. return StringUtils.format("Logger{name=[%s], class[%s]}", log.getName(), log.getClass());
  5. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. @Override public String getName() { return actual.getName(); }
  2. @Override public boolean isTraceEnabled() { return actual.isTraceEnabled(); }

代码示例来源:origin: Graylog2/graylog2-server

  1. public PacketInformationDumper(MessageInput sourceInput) {
  2. sourceInputName = sourceInput.getName();
  3. sourceInputId = sourceInput.getId();
  4. sourceInputLog = LoggerFactory.getLogger(PacketInformationDumper.class.getCanonicalName() + "." + sourceInputId);
  5. LOG.debug("Set {} to TRACE for network packet metadata dumps of input {}", sourceInputLog.getName(),
  6. sourceInput.getUniqueReadableId());
  7. }

代码示例来源:origin: codecentric/spring-boot-admin

  1. protected Mono<Instance> doUpdateStatus(Instance instance) {
  2. if (!instance.isRegistered()) {
  3. return Mono.empty();
  4. }
  5. log.debug("Update status for {}", instance);
  6. return instanceWebClient.instance(instance)
  7. .get()
  8. .uri(Endpoint.HEALTH)
  9. .exchange()
  10. .log(log.getName(), Level.FINEST)
  11. .flatMap(this::convertStatusInfo)
  12. .doOnError(ex -> logError(instance, ex))
  13. .onErrorResume(this::handleError)
  14. .map(instance::withStatusInfo);
  15. }

代码示例来源:origin: codecentric/spring-boot-admin

  1. public void start() {
  2. this.subscription = Flux.interval(this.checkReminderInverval, Schedulers.newSingle("reminders"))
  3. .log(log.getName(), Level.FINEST)
  4. .doOnSubscribe(s -> log.debug("Started reminders"))
  5. .flatMap(i -> this.sendReminders())
  6. .onErrorContinue((ex, value) -> log.warn(
  7. "Unexpected error while sending reminders",
  8. ex
  9. ))
  10. .subscribe();
  11. }

代码示例来源:origin: codecentric/spring-boot-admin

  1. public void start() {
  2. subscription = Flux.from(publisher)
  3. .log(log.getName(), Level.FINEST)
  4. .doOnSubscribe(s -> log.debug("Subscribed to {} events", eventType))
  5. .ofType(eventType)
  6. .cast(eventType)
  7. .compose(this::handle)
  8. .onErrorContinue((ex, value) -> log.warn("Unexpected error while handling {}", value, ex))
  9. .subscribe();
  10. }

代码示例来源:origin: codecentric/spring-boot-admin

  1. @Override
  2. public void start() {
  3. super.start();
  4. intervalSubscription = Flux.interval(updateInterval)
  5. .doOnSubscribe(s -> log.debug("Scheduled status update every {}", updateInterval))
  6. .log(log.getName(), Level.FINEST)
  7. .subscribeOn(Schedulers.newSingle("status-monitor"))
  8. .concatMap(i -> this.updateStatusForAllInstances())
  9. .onErrorContinue((ex, value) -> log.warn("Unexpected error while updating statuses",
  10. ex
  11. ))
  12. .subscribe();
  13. }

代码示例来源:origin: oblac/jodd

  1. @Test
  2. void testGetName() {
  3. //given
  4. when(log.getName()).thenReturn(LoggerConstants.LOG);
  5. //then
  6. assertEquals(logger.getName(), LoggerConstants.LOG);
  7. }

相关文章