WIP
This page details a creating a logging example starting with spring boot and perhaps making for example a REST call sequencer so it can be of use in both generating its own and other component logs.
The Logging implementation will be EELF
- LOG-118Getting issue details... STATUS
Purpose
The goals of the logging project are the following
provide for standardized logs across all ONAP components
provide ELK framework for log capture, indexing and presentation/search
provide framework for requestID tracking of distributed transactions (correlation ID's in p.162 of Building Microservices 2015 by Sam Newman) via HTTP ETags
Deploying the RI
Design Issues
DI 1: 20171231: Initial Maven Project Structure
https://gerrit.onap.org/r/#/admin/projects/logging-analytics
git clone ssh://michaelobrien@gerrit.onap.org:29418/logging-analytics
see
obrienbiometrics:logging-analytics michaelobrien$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: reference/logging-demo/.gitignore new file: reference/logging-demo/pom.xml new file: reference/logging-demo/src/main/java/org/onap/logging/LoggingReference.java new file: reference/logging-library/.gitignore new file: reference/logging-library/pom.xml new file: reference/logging-library/src/main/java/org/onap/logging/LoggingReference.java new file: reference/pom.xml Untracked files: (use "git add <file>..." to include in what will be committed) reference/.project reference/.settings/ reference/logging-demo/.checkstyle reference/logging-demo/.classpath reference/logging-demo/.project reference/logging-demo/.settings/ reference/logging-library/.checkstyle reference/logging-library/.classpath reference/logging-library/.project reference/logging-library/.settings/ reference/target/ obrienbiometrics:logging-analytics michaelobrien$ git commit -m "Initial logging lib/demo proj struct" [master 9e42247] Initial logging lib/demo proj struct 7 files changed, 306 insertions(+) create mode 100644 reference/logging-demo/.gitignore create mode 100644 reference/logging-demo/pom.xml create mode 100644 reference/logging-demo/src/main/java/org/onap/logging/LoggingReference.java create mode 100644 reference/logging-library/.gitignore create mode 100644 reference/logging-library/pom.xml create mode 100644 reference/logging-library/src/main/java/org/onap/logging/LoggingReference.java create mode 100644 reference/pom.xml obrienbiometrics:logging-analytics michaelobrien$ git review -s obrienbiometrics:logging-analytics michaelobrien$ git commit -s --amend [master c11cd50] Initial logging lib/demo proj struct Date: Sun Dec 31 13:30:04 2017 -0500 7 files changed, 306 insertions(+) create mode 100644 reference/logging-demo/.gitignore create mode 100644 reference/logging-demo/pom.xml create mode 100644 reference/logging-demo/src/main/java/org/onap/logging/LoggingReference.java create mode 100644 reference/logging-library/.gitignore create mode 100644 reference/logging-library/pom.xml create mode 100644 reference/logging-library/src/main/java/org/onap/logging/LoggingReference.java create mode 100644 reference/pom.xml obrienbiometrics:logging-analytics michaelobrien$ git review Warning: Permanently added '[gerrit.onap.org]:29418,[198.145.29.92]:29418' (RSA) to the list of known hosts. remote: Processing changes: new: 1, refs: 1, done remote: remote: New Changes: remote: https://gerrit.onap.org/r/27195 Initial logging lib/demo proj struct remote: To ssh://gerrit.onap.org:29418/logging-analytics * [new branch] HEAD -> refs/publish/master
For eclipse you will need to make sure the spring nature in the .classpath is set correctly - in order for maven build to also work in eclipse for war projects - this will show up in the project build path
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <attributes> <attribute name="maven.pomderived" value="true"/> <attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> </attributes> </classpathentry>
DI 2: 20171231: Audit: EELF implementors
app | project | repo | version |
---|---|---|---|
aai | aai-common | 1.0.0 | |
aai | aai-core | 1.0.0 | |
aai | aai-service (deprecated) | 0.0.1 | |
aai | aai-traversal | 1.0.0 | |
aai | ajsc-aai | 1.0.0 | |
aai | eelf-logging | logging-service | 0.0.1 |
appc | needs this RI - provide a demo to the team | ||
ui | dcae_dmaap_webapp | dmaapbc | 1.0.0 |
ui | dmaap-bc-app-common | 1.0.0 | |
ui | dmaap-bc-app-parent | 1.0.0 | |
policy | common-modules/ | common | 1.0.0 |
policy | drools-pdp | 1.0.0 | |
portal | ecompportal-be-common | portal | <eelf.version>1.0.0 |
policy | feature-eelf | drools-pdp | 1.0.0 |
policy | PolicyEngineSuite/ONAP-logging | common | 0.0.1 |
policy | ONAP-SDK-APP | engine | 0.0.1 |
vid | epsdk-app-onap | vid | 1.0.0 |
vid | vid-app-common | vid | 1.0.0 |
DI 3: 20171231: Audit: Mixed version of EELF dependency
- LOG-110Getting issue details... STATUS
Figuring out the reason for the different dependencies
aai-service, ajsc-aai, common-modules/common-logging
<dependency>
<groupId>com.att.eelf</groupId>
<artifactId>eelf-core</artifactId>
<version>0.0.1</version>
</dependency>
aai-common, eelf-logging, ONAP-logging, ONAP-SDK-APP
<dependency>
<groupId>com.att.eelf</groupId>
<artifactId>eelf-core</artifactId>
<version>1.0.0</version>
</dependency>
DI 4: 20170104: ETag propagation
Passing UUID based requestID's via rest calls
https://en.wikipedia.org/wiki/HTTP_ETag
Implementation
Testing
http://127.0.0.1:8080/logging-demo/rest/read/test
Links
EELF
git clone https://github.com/att/EELF.git
https://tomcat.apache.org/download-80.cgi
https://spring.io/tools/sts/all
https://www.sitepoint.com/inside-java-9-part-ii/#performanceimprovements