-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #488 from groldan/observability/json_logging_1.8.x
[backport 1.8.x] Enable logstash-formatted JSON logging to the console #487
- Loading branch information
Showing
14 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule config
updated
3 files
+3 −1 | gateway-service.yml | |
+17 −0 | logback-spring.xml | |
+5 −0 | rabbitmq.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Observability starter | ||
|
||
Spring-Boot starter project to treat application observability (logging, metrics, tracing) as a cross-cutting concern. | ||
|
||
## Dependency | ||
|
||
Add dependency | ||
|
||
```xml | ||
<dependency> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starter-observability</artifactId> | ||
<version>${project.verison}</version> | ||
</dependency> | ||
``` | ||
|
||
## Logstash formatted JSON Logging | ||
|
||
The `net.logstash.logback:logstash-logback-encoder` dependency allows to write logging entries as JSON-formatted objects in Logstash scheme. | ||
|
||
The application must be run with the `json-logs` Spring profile, as defined in [logback-spring.xml](src/main/resources/logback-spring.xml). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.geoserver.cloud</groupId> | ||
<artifactId>gs-cloud-starters</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
<artifactId>gs-cloud-starter-observability</artifactId> | ||
<packaging>jar</packaging> | ||
<description>Spring boot starter for application observability (logging, metrics, tracing)</description> | ||
<dependencies> | ||
<dependency> | ||
<groupId>net.logstash.logback</groupId> | ||
<artifactId>logstash-logback-encoder</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
17 changes: 17 additions & 0 deletions
17
src/starters/observability/src/main/resources/logback-spring.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<configuration> | ||
|
||
<springProfile name="default"> | ||
<include resource="org/springframework/boot/logging/logback/base.xml" /> | ||
</springProfile> | ||
|
||
<springProfile name="json-logs"> | ||
<appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder class="net.logstash.logback.encoder.LogstashEncoder" /> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="jsonConsoleAppender" /> | ||
</root> | ||
</springProfile> | ||
|
||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters