Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,48 @@ All in all, you should do the following:
4. Adjust your logging configuration accordingly.

Let's 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 nexus version (currently `4.3.0`):
POM with a property `cf-java-logging-support.version`, referring to the latest released version (currently `4.3.0`):

```xml

<properties>
<cf-logging-version>4.3.0</cf-logging-version>
<cf-java-logging-support.version>4.3.0</cf-java-logging-support.version>
</properties>
```

``` xml
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${cf-logging-version}</version>
<version>${cf-java-logging-support.version}</version>
</dependency>
```

This feature only depends on the servlet API which you have included in your POM anyhow. You can find more information
about the *servlet filter* feature (like e.g. how to adjust the web.xml) in
the [Wiki](https://github.com/SAP/cf-java-logging-support/wiki/Instrumenting-Servlets).

### Bill of Materials (BOM)

If you want to use multiple features, you may want to consider using the provided BOM (Bill of Materials) to avoid
version conflicts. You can find the BOM in the `cf-java-logging-support-bom` module. To use it, add the following to your POM:

``` xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-bom</artifactId>
<version>${cf-java-logging-support.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
```

You can control the version of all features by just changing the property `cf-java-logging-support.version` in your POM and omitting any version in your `cf-java-logging-support` dependencies. Please note that our BOM manages solely the versions of the `cf-java-logging-support` features, but not the versions of the logging implementation backends or other used libraries (e.g. logback or log4j2).

## Implementation variants and logging configurations

The *core* feature (on which all other features rely) is just using the `org.slf4j` API, but to actually get logs
Expand All @@ -103,7 +124,7 @@ corresponding dependencies in your POM file:
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-logback</artifactId>
<version>${cf-logging-version}</version>
<version>${cf-java-logging-support.version}</version>
</dependency>

<dependency>
Expand All @@ -119,7 +140,7 @@ corresponding dependencies in your POM file:
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-log4j2</artifactId>
<version>${cf-logging-version}</version>
<version>${cf-java-logging-support.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
47 changes: 47 additions & 0 deletions cf-java-logging-support-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>

<artifactId>cf-java-logging-support-bom</artifactId>
<packaging>pom</packaging>
<description>Bill of Materials for cf-java-logging-support dependencies</description>
<name>cf-java-logging-support-bom</name>

<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>4.3.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-logback</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-log4j2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-servlet</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-servlet-dynlog-jwt</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
</properties>

<modules>
<module>cf-java-logging-support-bom</module>
<module>cf-java-logging-support-core</module>
<module>cf-java-logging-support-logback</module>
<module>cf-java-logging-support-log4j2</module>
Expand Down
Loading