Skip to content

Commit 59da7de

Browse files
Merge pull request #142 from SAP/refactor-json-generation-log4j2
Refactor json generation log4j2
2 parents 4e151c4 + a3b1718 commit 59da7de

File tree

59 files changed

+1070
-2756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1070
-2756
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,31 @@
55

66
## Summary
77

8-
This is a collection of support libraries for Java applications (Java 8 and above) running on Cloud Foundry that serves three main purposes: It provides (a) means to emit *structured application log messages*, (b) instrument parts of your application stack to *collect request metrics* and (c) allow production of *custom metrics*.
8+
This is a collection of support libraries for Java applications (Java 8 and above) that serves three main purposes:
99

10-
When we say structured, we actually mean in JSON format. In that sense, it shares ideas with [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder) (and a first internal version was actually based on it), but takes a simpler approach as we want to ensure that these structured messages adhere to standardized formats. With such standardized formats in place, it becomes much easier to ingest, process and search such messages in log analysis stacks such as [ELK](https://www.elastic.co/webinars/introduction-elk-stack).
10+
1. Provide means to emit *structured application log messages*
11+
2. Instrument parts of your application stack to *collect request metrics*
12+
3. Allow production of *custom metrics*.
13+
14+
The libraries started out to support applications running on Cloud Foundry.
15+
This integration has become optional.
16+
The library can be used in any runtime environment such as Kubernetes or Kyma.
17+
18+
When we say structured, we actually mean in JSON format.
19+
In that sense, it shares ideas with [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder), but takes a simpler approach as we want to ensure that these structured messages adhere to standardized formats.
20+
With such standardized formats in place, it becomes much easier to ingest, process and search such messages in log analysis stacks such as [ELK](https://www.elastic.co/webinars/introduction-elk-stack).
1121

1222
If you're interested in the specifications of these standardized formats, you may want to have a closer look at the `fields.yml` files in the [beats folder](./cf-java-logging-support-core/beats).
1323

1424
While [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder) is tied to [logback](http://logback.qos.ch/), we've tried to keep implementation neutral and have implemented the core functionality on top of [slf4j](http://www.slf4j.org/), but provided implementations for both [logback](http://logback.qos.ch/) and [log4j2](http://logging.apache.org/log4j/2.x/) (and we're open to contributions that would support other implementations).
1525

16-
The instrumentation part is currently focusing on providing [request filters for Java Servlets](http://www.oracle.com/technetwork/java/filters-137243.html) and [client and server filters for Jersey](https://jersey.java.net/documentation/latest/filters-and-interceptors.html), but again, we're open to contributions for other APIs and frameworks.
26+
The instrumentation part is currently focusing on providing [request filters for Java Servlets](http://www.oracle.com/technetwork/java/filters-137243.html), but again, we're open to contributions for other APIs and frameworks.
1727

18-
The custom metrics instrumentation allows users to easily define and emit custom metrics. The different modules configure all necessary components and make it possible to define custom metrics with minimal code change.
28+
The custom metrics instrumentation allows users to easily define and emit custom metrics.
29+
The different modules configure all necessary components and make it possible to define custom metrics with minimal code change.
30+
Once collected, custom metrics are sent as special log message.
1931

20-
Lastly, there are also two sibling projects on [node.js logging support](https://github.com/SAP/cf-nodejs-logging-support) and [python logging support](https://github.com/SAP/cf-python-logging-support).
32+
Lastly, there is also a project on [node.js logging support](https://github.com/SAP/cf-nodejs-logging-support).
2133

2234
## Features and dependencies
2335

@@ -95,7 +107,7 @@ Again, we don't include dependencies to those implementation backends ourselves,
95107
<dependency>
96108
<groupId>ch.qos.logback</groupId>
97109
<artifactId>logback-classic</artifactId>
98-
<version>1.2.10</version>
110+
<version>1.2.11</version>
99111
</dependency>
100112
```
101113

@@ -110,12 +122,12 @@ Again, we don't include dependencies to those implementation backends ourselves,
110122
<dependency>
111123
<groupId>org.apache.logging.log4j</groupId>
112124
<artifactId>log4j-slf4j-impl</artifactId>
113-
<version>2.17.1</version>
125+
<version>2.17.2</version>
114126
</dependency>
115127
<dependency>
116128
<groupId>org.apache.logging.log4j</groupId>
117129
<artifactId>log4j-core</artifactId>
118-
<version>2.17.1</version>
130+
<version>2.17.2</version>
119131
</dependency>
120132
```
121133

cf-java-logging-support-core/src/main/java/com/sap/hcp/cf/logging/common/converter/DefaultCustomFieldsConverter.java

Lines changed: 0 additions & 129 deletions
This file was deleted.

cf-java-logging-support-core/src/main/java/com/sap/hcp/cf/logging/common/converter/DefaultMessageConverter.java

Lines changed: 0 additions & 74 deletions
This file was deleted.

cf-java-logging-support-core/src/main/java/com/sap/hcp/cf/logging/common/converter/DefaultPropertiesConverter.java

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)