Closed KouShenhai closed 1 day ago
[!CAUTION]
Review failed
The pull request is closed.
The changes in this pull request primarily involve updates to the logging configuration files across various services in the laokou
project. The modifications include enhancements to the JsonLayout
settings for console and file appenders, shifting log file formats from .log
to .json
, and adjusting attributes for improved logging detail and structure. These updates aim to standardize the logging output across different environments (development, production, test) and enhance the overall logging capabilities.
File Path | Change Summary |
---|---|
laokou-cloud/laokou-gateway/src/main/resources/log4j2-*.xml | Updated JsonLayout configurations for console and file appenders to include additional attributes and changed file extensions from .log to .json . |
laokou-cloud/laokou-monitor/src/main/resources/log4j2-*.xml | Similar updates to JsonLayout configurations, including changes in file naming conventions and additional attributes for enhanced logging detail. |
laokou-sample/laokou-sample-/src/main/resources/log4j2-.xml | Changes include updates to JsonLayout configurations, file extensions updated from .log to .json , and additional attributes for structured logging in both console and file appenders. |
laokou-service/laokou-/laokou--start/src/main/resources/log4j2-*.xml | Modifications to JsonLayout for console and file appenders, with a focus on changing file extensions to .json , updating attributes for improved logging detail, and maintaining existing logging structure. |
laokou-service/laokou-logstash/laokou-logstash-/src/main/resources/log4j2-.xml | Adjustments to JsonLayout configurations for both console and file appenders, including changes in file naming conventions to .json and updates to attributes for enhanced logging. |
laokou-service/laokou-report/laokou-report-start/src/main/resources/log4j2-*.xml | Significant updates to JsonLayout configurations, file extensions changed to .json , and additional attributes added for both console and file appenders, enhancing the structured logging output. |
laokou-service/laokou-auth/laokou-auth-start/src/main/resources/log4j2-*.xml | Similar changes to JsonLayout configurations with a focus on file extension updates and additional attributes for improved logging detail. |
laokou-service/laokou-generator/laokou-generator-start/src/main/resources/log4j2-*.xml | Updates to JsonLayout configurations, including file extension changes from .log to .json and enhancements in logging detail through additional attributes. |
laokou-service/laokou-iot/laokou-iot-start/src/main/resources/log4j2-*.xml | Modifications to logging configurations reflecting a shift in file format from .log to .json and updates to JsonLayout attributes for enhanced detail. |
laokou-service/laokou-logstash/laokou-logstash-app/src/main/java/org/laokou/logstash/handler/TraceHandler.java | Addition of a new field stacktrace in the TraceIndex class to store stack trace information, enhancing the data structure for logging trace information. |
In the fields of code we play,
With logs that dance in bright array.
From.log
to.json
, we cheer,
More details now, the path is clear!
Attributes added, structure refined,
In the world of logs, new treasures we find! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
此 PR 在整个应用程序中实现了全面的日志改进,重点是增强的 JSON 日志配置和堆栈跟踪处理。更改将日志输出格式标准化为 JSON,并添加了更好的错误跟踪功能。
classDiagram
class JsonLayout {
+toSerializable(LogEvent event, Writer writer)
+getFieldsMap(LogEvent event) Map<String, String>
+getStackTraceAsString(Throwable throwable) String
}
note for JsonLayout "添加了方法 getStackTraceAsString 以处理堆栈跟踪转换为字符串。"
classDiagram
class TraceIndex {
+String message
+String stacktrace
}
note for TraceIndex "添加了堆栈跟踪字段以增强错误跟踪。"
更改 | 详情 | 文件 |
---|---|---|
增强了所有服务的 JSON 日志配置 |
|
laokou-cloud/laokou-gateway/src/main/resources/log4j2-prod.xml laokou-service/laokou-admin/laokou-admin-start/src/main/resources/log4j2-prod.xml laokou-service/laokou-auth/laokou-auth-start/src/main/resources/log4j2-prod.xml laokou-service/laokou-generator/laokou-generator-start/src/main/resources/log4j2-prod.xml laokou-service/laokou-iot/laokou-iot-start/src/main/resources/log4j2-prod.xml laokou-service/laokou-report/laokou-report-start/src/main/resources/log4j2-prod.xml |
改进了 JSON 日志中的堆栈跟踪处理 |
|
laokou-common/laokou-common-log4j2/src/main/java/org/apache/logging/log4j/core/layout/JsonLayout.java laokou-service/laokou-logstash/laokou-logstash-app/src/main/java/org/laokou/logstash/handler/TraceHandler.java |
代码格式改进 |
|
laokou-sample/laokou-sample-shardingsphere/src/main/java/org/laokou/start/ShardingTestApp.java laokou-sample/laokou-sample-tcp/src/main/java/org/laokou/start/TcpTestApp.java |
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Attention: Patch coverage is 0%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 17.06%. Comparing base (
93dddb1
) to head (c9f0e41
). Report is 3 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
...rc/main/java/org/laokou/start/ShardingTestApp.java | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by Sourcery
通过修改JsonLayout设置和将日志文件扩展名更改为.json,更新日志配置以改善JSON日志结构并提高服务间的一致性。
增强功能:
Original summary in English
## Summary by Sourcery Update logging configurations to improve JSON logging structure and consistency across services by modifying JsonLayout settings and changing log file extensions to .json. Enhancements: - Enhance logging configuration by updating JsonLayout settings across multiple services to include additional properties such as stacktrace and objectMessageAsJsonObject. - Change log file extensions from .log to .json for better structured logging and consistency across services.Summary by CodeRabbit
New Features
Bug Fixes
.json
extension.Documentation
Chores