Skip to content

Commit

Permalink
Merge pull request #49 from SAP/fix-orgname
Browse files Browse the repository at this point in the history
Fix cf org name and id, bump version to 3.0.5
  • Loading branch information
anklei authored Oct 18, 2019
2 parents d818cbb + 2682081 commit e626102
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ All in all, you should do the following:
And
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 `3.0.4`):
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`):

```xml
<properties>
<cf-logging-version>3.0.4</cf-logging-version>
<cf-logging-version>3.0.5</cf-logging-version>
</properties>
```

Expand Down
2 changes: 1 addition & 1 deletion cf-java-logging-support-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class VcapEnvReader {
private static final String CF_INSTANCE_INDEX = "instance_index";
private static final String CF_SPACE_ID = "space_id";
private static final String CF_SPACE_NAME = "space_name";
private static final String CF_ORGANIZATION_ID = "organization_id";
private static final String CF_ORGANIZATION_NAME = "organization_name";

/*
* for testing purposes only!
Expand Down Expand Up @@ -80,6 +82,8 @@ public static void getAppInfos(Map<String, String> tags, Set<String> envKeys) {
addField(tags, envKeys, envMap, CF_INSTANCE_INDEX, Fields.COMPONENT_INSTANCE);
addField(tags, envKeys, envMap, CF_SPACE_ID, Fields.SPACE_ID);
addField(tags, envKeys, envMap, CF_SPACE_NAME, Fields.SPACE_NAME);
addField(tags, envKeys, envMap, CF_ORGANIZATION_ID, Fields.ORGANIZATION_ID);
addField(tags, envKeys, envMap, CF_ORGANIZATION_NAME, Fields.ORGANIZATION_NAME);
} catch (Exception ex) {
LoggerFactory.getLogger(VcapEnvReader.class).error("Cannot get infos from environment", ex);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,38 @@ public class EnvMap {
public static final String VCAP_APP_ID = "867b99ba-1caa-4d91-b2ee-82982234f58a";
public static final String VCAP_SPACE_NAME = "test-space";
public static final String VCAP_SPACE_ID = "69ca5b0f-cc66-4f8e-9d17-f102f60142e2";
public static final String VCAP_ORGANIZATION_NAME = "test-org";
public static final String VCAP_ORGANIZATION_ID = "6b8cf2f9-bf9a-45f6-8774-0a0f42cb27f3";
public static final String VCAP_INSTANCE_IDX = "0";

public static final String VCAP_APPLICATION = "{\"limits\":{\"mem\":256,\"disk\":1024,\"fds\":16384}, " +
"\"application_version\":\"a9efcfae-ee23-465f-9985-401099500825\"," +
"\"application_name\":\"" + VCAP_APP_NAME + "\"," +
"\"application_uris\":[\"test-app.acme.org\"],\"version\":\"a9efcfae-ee23-465f-9985-401099500825\",\"name\":\"test-app\"," +
"\"space_name\":\"" + VCAP_SPACE_NAME + "\"," + "\"space_id\":\"" +
VCAP_SPACE_ID + "\"," +
"\"uris\":[\"test-app.acme.org\"],\"users\":null," +
"\"application_id\":\"" + VCAP_APP_ID + "\"," +
"\"instance_id\":\"3b671ef5fd86407cb8807f303824c870\"," +
"\"instance_index\":\"" + VCAP_INSTANCE_IDX + "\"," +
"\"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}";
public static final String VCAP_APPLICATION = "{" +
"\"application_id\":\"" + VCAP_APP_ID + "\", " +
"\"application_name\":\"" + VCAP_APP_NAME + "\", " +
"\"application_uris\":[ " +
"\"testapp.testdomain.com\" " +
"], " +
"\"application_version\":\"92720bd3-2735-489d-bf4b-e5bb05c752e7\", " +
"\"cf_api\":\"https://api.cf.sap.hana.ondemand.com\", " +
"\"host\":\"0.0.0.0\", " +
"\"instance_id\":\"34b12c70-5443-426f-75c4-3260\", " +
"\"instance_index\":\"" + VCAP_INSTANCE_IDX + "\", " +
"\"limits\":{ " +
"\"disk\":1024, " +
"\"fds\":16384, " +
"\"mem\":1024 " +
"}, " +
"\"name\":\"d048888-logging-sample-app\", " +
"\"organization_id\":\"" + VCAP_ORGANIZATION_ID + "\", " +
"\"organization_name\":\"" + VCAP_ORGANIZATION_NAME + "\", " +
"\"port\":8080, " +
"\"process_id\":\"a6026141-8d69-4e9d-b62d-8e1d982f7953\", " +
"\"process_type\":\"web\", " +
"\"space_id\":\"" + VCAP_SPACE_ID + "\", " +
"\"space_name\":\"" +VCAP_SPACE_NAME + "\", " +
"\"uris\":[ " +
"\"testapp.testdomain.com\" " +
"], " +
"\"version\":\"92720bd3-2735-489d-bf4b-e5bb05c752e7\" " +
"}";

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public void testWithEnv() {
assertTrue(tags.get(Fields.COMPONENT_INSTANCE).equals(EnvMap.VCAP_INSTANCE_IDX));
assertTrue(tags.get(Fields.SPACE_ID).equals(EnvMap.VCAP_SPACE_ID));
assertTrue(tags.get(Fields.SPACE_NAME).equals(EnvMap.VCAP_SPACE_NAME));
assertTrue(tags.get(Fields.ORGANIZATION_ID).equals(EnvMap.VCAP_ORGANIZATION_ID));
assertTrue(tags.get(Fields.ORGANIZATION_NAME).equals(EnvMap.VCAP_ORGANIZATION_NAME));
VcapEnvReader.setEnvMap(null);
}

Expand All @@ -34,6 +36,8 @@ public void testNoOverride() {
assertTrue(tags.get(Fields.COMPONENT_INSTANCE).equals(EnvMap.VCAP_INSTANCE_IDX));
assertTrue(tags.get(Fields.SPACE_ID).equals(EnvMap.VCAP_SPACE_ID));
assertTrue(tags.get(Fields.SPACE_NAME).equals(EnvMap.VCAP_SPACE_NAME));
assertTrue(tags.get(Fields.ORGANIZATION_ID).equals(EnvMap.VCAP_ORGANIZATION_ID));
assertTrue(tags.get(Fields.ORGANIZATION_NAME).equals(EnvMap.VCAP_ORGANIZATION_NAME));
VcapEnvReader.setEnvMap(null);
}
}
2 changes: 1 addition & 1 deletion cf-java-logging-support-jersey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<relativePath>../pom.xml</relativePath>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<name>cf-java-logging-support-jersey</name>
Expand Down
2 changes: 1 addition & 1 deletion cf-java-logging-support-log4j2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<relativePath>../pom.xml</relativePath>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion cf-java-logging-support-logback/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../pom.xml</relativePath>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion cf-java-logging-support-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-monitoring-custom-metrics-clients</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<artifactId>cf-custom-metrics-clients-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-monitoring-custom-metrics-clients</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<artifactId>cf-custom-metrics-clients-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-monitoring-custom-metrics-clients</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
</parent>

<artifactId>cf-custom-metrics-clients-spring-boot</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cf-java-monitoring-custom-metrics-clients/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<packaging>pom</packaging>

<name>Cloud Foundry Java logging support components</name>
Expand All @@ -18,7 +18,7 @@
<organizationUrl>https://github.com/SAP</organizationUrl>
</developer>
<developer>
<id>anklei</id>
<id>akl</id>
<name>Andreas Klein</name>
<email>[email protected]</email>
<organization>SAP SE</organization>
Expand Down Expand Up @@ -86,6 +86,13 @@
<organization>SAP SE</organization>
<organizationUrl>https://github.com/SAP</organizationUrl>
</developer>
<developer>
<id>HariG</id>
<name>Hariharan Gandhi</name>
<email>[email protected]</email>
<organization>SAP SE</organization>
<organizationUrl>https://github.com/SAP</organizationUrl>
</developer>
</developers>

<licenses>
Expand Down
2 changes: 1 addition & 1 deletion sample/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ applications:
#
- name: logging-sample-app
instances: 1
path: target/logging-sample-app-3.0.4.war
path: target/logging-sample-app-3.0.5.war
env:
RANDOM_SLEEP: true
# Set LOG_*: true to activate logging of respective field
Expand Down
2 changes: 1 addition & 1 deletion sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.sap.hcp.cf.logging</groupId>
<artifactId>cf-java-logging-support-parent</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit e626102

Please sign in to comment.