Skip to content

Commit d9e0e01

Browse files
authored
Merge pull request #19 from SAP/remoteIP
Version 2.1.2
2 parents 955eea8 + 38081ed commit d9e0e01

File tree

20 files changed

+191
-25
lines changed

20 files changed

+191
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ All in all, you should do the following:
2727
* adjust your logging configuration accordingly.
2828

2929

30-
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 `2.1.1`):
30+
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 `2.1.2`):
3131

3232
```xml
3333
<properties>
34-
<cf-logging-version>2.1.1</cf-logging-version>
34+
<cf-logging-version>2.1.2</cf-logging-version>
3535
</properties>
3636
```
3737

cf-java-logging-support-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<parent>
3333
<groupId>com.sap.hcp.cf.logging</groupId>
3434
<artifactId>cf-java-logging-support-parent</artifactId>
35-
<version>2.1.1</version>
35+
<version>2.1.2</version>
3636
<relativePath>../pom.xml</relativePath>
3737
</parent>
3838
<build>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public void convert(String message, StringBuilder appendTo) {
4848
} else {
4949
appendTo.append(result);
5050
}
51+
} else {
52+
appendTo.append("null");
5153
}
54+
5255
}
5356

5457
private String flattenMsg(String msg) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.sap.hcp.cf.logging.common.helper;
2+
3+
public class Environment {
4+
5+
public static final String LOG_REMOTE_IP = "LOG_REMOTE_IP";
6+
7+
public String getVariable(String name) {
8+
return System.getenv(name);
9+
}
10+
}

cf-java-logging-support-core/src/test/java/com/sap/hcp/cf/logging/common/converter/TestJsonMessageConverter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,11 @@ public void testObjNestedBrackets() {
114114
assertThat(formatMsg(jmc, logMsg), is(nestedBracketsMsg));
115115
}
116116

117+
@Test
118+
public void testNullMessage() {
119+
String logMsg = null;
120+
DefaultMessageConverter jmc = new DefaultMessageConverter();
121+
assertThat(formatMsg(jmc, logMsg), is("null"));
122+
}
123+
117124
}

cf-java-logging-support-jersey/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<relativePath>../pom.xml</relativePath>
1010
<groupId>com.sap.hcp.cf.logging</groupId>
1111
<artifactId>cf-java-logging-support-parent</artifactId>
12-
<version>2.1.1</version>
12+
<version>2.1.2</version>
1313
</parent>
1414

1515
<name>cf-java-logging-support-jersey</name>

cf-java-logging-support-log4j2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<relativePath>../pom.xml</relativePath>
1212
<groupId>com.sap.hcp.cf.logging</groupId>
1313
<artifactId>cf-java-logging-support-parent</artifactId>
14-
<version>2.1.1</version>
14+
<version>2.1.2</version>
1515
</parent>
1616

1717
<dependencies>

cf-java-logging-support-logback/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<relativePath>../pom.xml</relativePath>
1111
<groupId>com.sap.hcp.cf.logging</groupId>
1212
<artifactId>cf-java-logging-support-parent</artifactId>
13-
<version>2.1.1</version>
13+
<version>2.1.2</version>
1414
</parent>
1515

1616
<dependencies>

cf-java-logging-support-servlet/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.sap.hcp.cf.logging</groupId>
1111
<artifactId>cf-java-logging-support-parent</artifactId>
12-
<version>2.1.1</version>
12+
<version>2.1.2</version>
1313
<relativePath>../pom.xml</relativePath>
1414
</parent>
1515

@@ -47,7 +47,7 @@
4747
<dependency>
4848
<groupId>com.auth0</groupId>
4949
<artifactId>java-jwt</artifactId>
50-
<version>3.2.0</version>
50+
<version>3.3.0</version>
5151
</dependency>
5252
</dependencies>
5353
</project>

cf-java-logging-support-servlet/src/main/java/com/sap/hcp/cf/logging/servlet/dynlog/DynLogEnvironment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import org.slf4j.Logger;
99
import org.slf4j.LoggerFactory;
1010

11+
import com.sap.hcp.cf.logging.common.helper.Environment;
12+
1113
public class DynLogEnvironment {
1214

1315
private static final Logger LOGGER = LoggerFactory.getLogger(DynLogEnvironment.class);

0 commit comments

Comments
 (0)