Skip to content

Commit e626102

Browse files
authored
Merge pull request #49 from SAP/fix-orgname
Fix cf org name and id, bump version to 3.0.5
2 parents d818cbb + 2682081 commit e626102

File tree

16 files changed

+61
-27
lines changed

16 files changed

+61
-27
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ All in all, you should do the following:
2929
And
3030
4. Adjust your logging configuration accordingly.
3131

32-
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 `3.0.4`):
32+
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 `3.0.5`):
3333

3434
```xml
3535
<properties>
36-
<cf-logging-version>3.0.4</cf-logging-version>
36+
<cf-logging-version>3.0.5</cf-logging-version>
3737
</properties>
3838
```
3939

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>3.0.4</version>
35+
<version>3.0.5</version>
3636
<relativePath>../pom.xml</relativePath>
3737
</parent>
3838
<build>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class VcapEnvReader {
3434
private static final String CF_INSTANCE_INDEX = "instance_index";
3535
private static final String CF_SPACE_ID = "space_id";
3636
private static final String CF_SPACE_NAME = "space_name";
37+
private static final String CF_ORGANIZATION_ID = "organization_id";
38+
private static final String CF_ORGANIZATION_NAME = "organization_name";
3739

3840
/*
3941
* for testing purposes only!
@@ -80,6 +82,8 @@ public static void getAppInfos(Map<String, String> tags, Set<String> envKeys) {
8082
addField(tags, envKeys, envMap, CF_INSTANCE_INDEX, Fields.COMPONENT_INSTANCE);
8183
addField(tags, envKeys, envMap, CF_SPACE_ID, Fields.SPACE_ID);
8284
addField(tags, envKeys, envMap, CF_SPACE_NAME, Fields.SPACE_NAME);
85+
addField(tags, envKeys, envMap, CF_ORGANIZATION_ID, Fields.ORGANIZATION_ID);
86+
addField(tags, envKeys, envMap, CF_ORGANIZATION_NAME, Fields.ORGANIZATION_NAME);
8387
} catch (Exception ex) {
8488
LoggerFactory.getLogger(VcapEnvReader.class).error("Cannot get infos from environment", ex);
8589
return;

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

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,38 @@ public class EnvMap {
88
public static final String VCAP_APP_ID = "867b99ba-1caa-4d91-b2ee-82982234f58a";
99
public static final String VCAP_SPACE_NAME = "test-space";
1010
public static final String VCAP_SPACE_ID = "69ca5b0f-cc66-4f8e-9d17-f102f60142e2";
11+
public static final String VCAP_ORGANIZATION_NAME = "test-org";
12+
public static final String VCAP_ORGANIZATION_ID = "6b8cf2f9-bf9a-45f6-8774-0a0f42cb27f3";
1113
public static final String VCAP_INSTANCE_IDX = "0";
12-
13-
public static final String VCAP_APPLICATION = "{\"limits\":{\"mem\":256,\"disk\":1024,\"fds\":16384}, " +
14-
"\"application_version\":\"a9efcfae-ee23-465f-9985-401099500825\"," +
15-
"\"application_name\":\"" + VCAP_APP_NAME + "\"," +
16-
"\"application_uris\":[\"test-app.acme.org\"],\"version\":\"a9efcfae-ee23-465f-9985-401099500825\",\"name\":\"test-app\"," +
17-
"\"space_name\":\"" + VCAP_SPACE_NAME + "\"," + "\"space_id\":\"" +
18-
VCAP_SPACE_ID + "\"," +
19-
"\"uris\":[\"test-app.acme.org\"],\"users\":null," +
20-
"\"application_id\":\"" + VCAP_APP_ID + "\"," +
21-
"\"instance_id\":\"3b671ef5fd86407cb8807f303824c870\"," +
22-
"\"instance_index\":\"" + VCAP_INSTANCE_IDX + "\"," +
23-
"\"host\":\"0.0.0.0\",\"port\":61999,\"started_at\":\"2015-03-17 12:07:49 +0000\",\"started_at_timestamp\":1426594069,\"start\":\"2015-03-17 12:07:49 +0000\",\"state_timestamp\":1426594069}";
14+
public static final String VCAP_APPLICATION = "{" +
15+
"\"application_id\":\"" + VCAP_APP_ID + "\", " +
16+
"\"application_name\":\"" + VCAP_APP_NAME + "\", " +
17+
"\"application_uris\":[ " +
18+
"\"testapp.testdomain.com\" " +
19+
"], " +
20+
"\"application_version\":\"92720bd3-2735-489d-bf4b-e5bb05c752e7\", " +
21+
"\"cf_api\":\"https://api.cf.sap.hana.ondemand.com\", " +
22+
"\"host\":\"0.0.0.0\", " +
23+
"\"instance_id\":\"34b12c70-5443-426f-75c4-3260\", " +
24+
"\"instance_index\":\"" + VCAP_INSTANCE_IDX + "\", " +
25+
"\"limits\":{ " +
26+
"\"disk\":1024, " +
27+
"\"fds\":16384, " +
28+
"\"mem\":1024 " +
29+
"}, " +
30+
"\"name\":\"d048888-logging-sample-app\", " +
31+
"\"organization_id\":\"" + VCAP_ORGANIZATION_ID + "\", " +
32+
"\"organization_name\":\"" + VCAP_ORGANIZATION_NAME + "\", " +
33+
"\"port\":8080, " +
34+
"\"process_id\":\"a6026141-8d69-4e9d-b62d-8e1d982f7953\", " +
35+
"\"process_type\":\"web\", " +
36+
"\"space_id\":\"" + VCAP_SPACE_ID + "\", " +
37+
"\"space_name\":\"" +VCAP_SPACE_NAME + "\", " +
38+
"\"uris\":[ " +
39+
"\"testapp.testdomain.com\" " +
40+
"], " +
41+
"\"version\":\"92720bd3-2735-489d-bf4b-e5bb05c752e7\" " +
42+
"}";
2443

2544
public static final String NOT_SET = "not-set";
2645

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public void testWithEnv() {
2020
assertTrue(tags.get(Fields.COMPONENT_INSTANCE).equals(EnvMap.VCAP_INSTANCE_IDX));
2121
assertTrue(tags.get(Fields.SPACE_ID).equals(EnvMap.VCAP_SPACE_ID));
2222
assertTrue(tags.get(Fields.SPACE_NAME).equals(EnvMap.VCAP_SPACE_NAME));
23+
assertTrue(tags.get(Fields.ORGANIZATION_ID).equals(EnvMap.VCAP_ORGANIZATION_ID));
24+
assertTrue(tags.get(Fields.ORGANIZATION_NAME).equals(EnvMap.VCAP_ORGANIZATION_NAME));
2325
VcapEnvReader.setEnvMap(null);
2426
}
2527

@@ -34,6 +36,8 @@ public void testNoOverride() {
3436
assertTrue(tags.get(Fields.COMPONENT_INSTANCE).equals(EnvMap.VCAP_INSTANCE_IDX));
3537
assertTrue(tags.get(Fields.SPACE_ID).equals(EnvMap.VCAP_SPACE_ID));
3638
assertTrue(tags.get(Fields.SPACE_NAME).equals(EnvMap.VCAP_SPACE_NAME));
39+
assertTrue(tags.get(Fields.ORGANIZATION_ID).equals(EnvMap.VCAP_ORGANIZATION_ID));
40+
assertTrue(tags.get(Fields.ORGANIZATION_NAME).equals(EnvMap.VCAP_ORGANIZATION_NAME));
3741
VcapEnvReader.setEnvMap(null);
3842
}
3943
}

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>3.0.4</version>
12+
<version>3.0.5</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>3.0.4</version>
14+
<version>3.0.5</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>3.0.4</version>
13+
<version>3.0.5</version>
1414
</parent>
1515

1616
<dependencies>

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

Lines changed: 1 addition & 1 deletion
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>3.0.4</version>
12+
<version>3.0.5</version>
1313
<relativePath>../pom.xml</relativePath>
1414
</parent>
1515

cf-java-monitoring-custom-metrics-clients/cf-custom-metrics-clients-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.hcp.cf.logging</groupId>
66
<artifactId>cf-java-monitoring-custom-metrics-clients</artifactId>
7-
<version>3.0.4</version>
7+
<version>3.0.5</version>
88
</parent>
99

1010
<artifactId>cf-custom-metrics-clients-core</artifactId>

0 commit comments

Comments
 (0)