2

SupportingServices - Logging

 2 years ago
source link: https://ahaedgar.github.io/2018/09/12/SupportingServices-Logging/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SupportingServices - Logging:

  • Introducion to Logging
  • Minimum Product Feature Set
  • High Level Design Architecture
  • Model Data
  • Model Dictionary
  • High Level Interaction Diagrams
  • Configuration Propertie
  • Logging Service Client Library for Java

1. Introduction to Logging

Logging对于所有现代软件应用程序至关重要。适当的日志记录能为用户提供以下好处:

  • 能够监控和了解系统正在做什么
  • 能够理解服务之间如何相互影响
  • 能够检测到问题,并快速修复

该图显示了EdgeX Foundry的高级设计架构,包括Logging Service。

2. Minimum Product Feature Set

为其他微服务提供RESTful API,以请求具有以下特征的日志项:

  • RESTful调用应该是非阻塞的,意味着调用服务直接触发日志请求,而不需要等待日志服务的任何响应,实现速度和服务性能影响的最小化
  • 支持多个日志记录级别,例如trace、debug、info、warn、error、fatal等。
  • 支持日志条目标记; 标签可以是调用服务所指示的任何内容。
  • 每个日志条目都应与其发起服务相关联。

提供RESTful API,以根据以下参数的任意组合查询、删除或修改日志条目:

  • Timestamp from
  • Timestamp to
  • Log level
  • Originating service (发起/起源服务)

日志项应保存在文件或数据库中,并且持久性存储应该在可配置级别的情况下进行管理

在内部利用现有的日志记录框架,EdgeX Foundry提供了“wrapper”供使用

尽可能遵循适用的日志记录标准,在网关上使用并不繁琐

3. High Level Design Architecture

上图显示了EdgeX Foundry Logging Service的高级体系结构,该服务使用Spring Boot Application Framework实现。其他微服务通过RESTful API与EdgeX Foundry Logging Service交互,以提交日志记录请求、查询历史日志记录以及删除历史日志记录。在内部,EdgeX Foundry Logging Service利用LOGBack作为其底层日志记录框架。EdgeX Foundry Logging Service支持两种可配置的持久性选项:文件或MongoDB。

4. Data Model

5. Data Dictionary

6. High Level Interaction Diagrams

本节显示EdgeX Foundry Logging Service的序列图.

  • Sequence Diagram for Logging Request
  • Sequence Diagram for Query Historical Logging
  • Sequence Diagram for Removing Historical Logging

7. Configuration Properties(略,详情参见官方文档)

默认配置文件位于源代码的/ src / main / resources文件夹中。与Configuration Management微服务交互时,配置位于Consul Key / Value Store的/ config / support-logging名称空间中。

8. Logging Service Client Library for Java(略,详情参见官方文档)

由于大多数EdgeX Foundry微服务都是用Java实现的,因此我们提供了Java客户端库,以便基于Java的微服务可以直接切换其Logger以使用EdgeX Foundry Logging Service。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK