Skip to content

Commit 4c5c81f

Browse files
committed
Work on documentation
1 parent 684ae20 commit 4c5c81f

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
This is a collection of support libraries for Java applications running on Cloud Foundry that serve two main purposes: It provides (a) means to emit *structured application log messages* and (b) instrument parts of your application stack to *collect request metrics*.
66

7-
When we say structured, we actually mean in JSON format. In that sense, it's shares ideas with [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder), but uses 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 analytic stacks like, e.g., [ELK](https://www.elastic.co/webinars/introduction-elk-stack).
7+
When we say structured, we actually mean in JSON format. In that sense, it's 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 like, e.g., [ELK](https://www.elastic.co/webinars/introduction-elk-stack).
88

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

1111
While [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder) is tied to [logback](http://logback.qos.ch/), we've tried to stay implementation neutral and have implemented the core functionality on top of [slf4j](http://www.slf4j.org/), but provide 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).
1212

1313
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.
1414

1515
## Features and dependencies
1616

17-
As you can see from the structure of this repository, we're not providing one *uber* JAR that contains everything, but provide each feature separately. We also try to stay away from wiring up too many dependencies by tagging almost all of them as *provided*, i.e. it's your duty to get all runtime dependencies resolved in your application POM file.
17+
As you can see from the structure of this repository, we're not providing one *uber* JAR that contains everything, but provide each feature separately. We also try to stay away from wiring up too many dependencies by tagging almost all of them as *provided.* As a consequence, it's your task to get all runtime dependencies resolved in your application POM file.
1818

1919
All in all, you should do the following:
2020

@@ -23,13 +23,13 @@ All in all, you should do the following:
2323
* pick your favorite logging implementation, and
2424
* adjust your logging configuration accordingly.
2525

26-
Say, you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM:
26+
Say, you want to make use of the *servlet filter* feature, then you need to add the following dependency to your POM with property `cf-logging-version` referring to the latest version (currently `2.0.8`):
2727

2828
``` xml
2929
<dependency>
3030
<groupId>com.sap.hcp.cf.logging</groupId>
3131
<artifactId>cf-java-logging-support-servlet</artifactId>
32-
<version>2.0.6</version>
32+
<version>${cf-logging-version}</version>
3333
</dependency>
3434
```
3535

@@ -50,7 +50,7 @@ Again, we don't include dependencies to those implementation backends ourselves,
5050
<dependency>
5151
<groupId>com.sap.hcp.cf.logging</groupId>
5252
<artifactId>cf-java-logging-support-logback</artifactId>
53-
<version>2.0.7</version>
53+
<version>${cf-logging-version}</version>
5454
</dependency>
5555

5656
<dependency>
@@ -66,7 +66,7 @@ Again, we don't include dependencies to those implementation backends ourselves,
6666
<dependency>
6767
<groupId>com.sap.hcp.cf.logging</groupId>
6868
<artifactId>java-logging-support-log4j2</artifactId>
69-
<version>2.0.7</version>
69+
<version>${cf-logging-version}</version>
7070
</dependency>
7171
<dependency>
7272
<groupId>org.apache.logging.log4j</groupId>
@@ -94,7 +94,7 @@ Here are sort of the minimal configurations you'd need:
9494
<!-- for local development, you may want to switch to a more human-readable layout -->
9595
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
9696
<encoder>
97-
<pattern>%date %-5level [%thread] - [%logger]- %msg%n</pattern>
97+
<pattern>%date %-5level [%thread] - [%logger] [%mdc] - %msg%n</pattern>
9898
</encoder>
9999
</appender>
100100
<root level="${LOG_ROOT_LEVEL:-WARN}">
@@ -117,7 +117,7 @@ Here are sort of the minimal configurations you'd need:
117117
<JsonPatternLayout charset="utf-8"/>
118118
</Console>
119119
<Console name="STDOUT" target="SYSTEM_OUT" follow="true">
120-
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
120+
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} [%mdc] - %msg%n"/>
121121
</Console>
122122
</Appenders>
123123
<Loggers>
@@ -129,4 +129,12 @@ Here are sort of the minimal configurations you'd need:
129129
<Logger name="com.sap.hcp.cf" level="INFO"/>
130130
</Loggers>
131131
</Configuration>
132-
```
132+
```
133+
134+
## Sample Application
135+
136+
In order to illustrate how the different features are used, this repository includes a simple application in the [./sample folder](./sample).
137+
138+
## Documentation
139+
140+
More info on the actual implementation can be found in the [Wiki](./wiki).

0 commit comments

Comments
 (0)