Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: filling out logging RI

Table of Contents

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

is the design and reference site for the Logging RI. The following topics are being provided to the rest of the ONAP community.

  • How to use the  EELF Logging Library
  • How to adhere to the logging guidelines
  • How to implement the filebeat sidecar container to push logs to the ELK stack pod
  • How to use the EELF AOP wrapping library
  • How to ensure requestID tracking during distributed transactions

Questions on onap-discuss from the teams
https://lists.onap.org/pipermail/onap-discuss/2018-January/007415.html

...

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

Audits

Existing EELF implementations

Please use the latest 1.0.0 from https://gerritgithub.onap.orgcom/r/#/admin/projects/logging-analytics

git clone ssh://michaelobrien@gerrit.onap.org:29418/logging-analytics

see

Code Block
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

Code Block
	<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

Please use the latest 1.0.0 from https://github.com/att/EELF - nexus artifacts pending

...

(pax.logging = wrapper on log4j, slf4j, commons-logging 1.2 and logback 1.1.1)

needs this RI - provide a demo to the appc team

...

att/EELF - nexus artifacts pending

appprojectrepoversion
aaiaai-common
1.0.0
aaiaai-core
1.0.0
aaiaai-service (deprecated)
0.0.1 (not in use)
aaiaai-traversal
1.0.0
aaiajsc-aai
1.0.0
aaieelf-logginglogging-service0.0.1 (not in use)
appc

(pax.logging = wrapper on log4j, slf4j, commons-logging 1.2 and logback 1.1.1)

needs this RI - provide a demo to the appc team


0.0.1 (upgrade?)
ccsdknbapiccsdk/platform/nbapi1.0.0
dmaapbuscontrollerdmaap/buscontroller0.0.1
uidcae_dmaap_webappdmaapbc1.0.0
uidmaap-bc-app-common
1.0.0
uidmaap-bc-app-parent
1.0.0
policycommon-modules/common1.0.0
policydrools-pdp
1.0.0
portalecompportal-be-commonportal
<eelf.version>1.0.0
</eelf.version>
policyfeature-eelfdrools-pdp1.0.0
policyPolicyEngineSuite/ONAP-loggingcommon0.0.1 (not in use)
policyONAP-SDK-APPengine0.0.1 (not in use)
sdc

?
socommonso0.0.1 (upgrade ?)
videpsdk-app-onapvid1.0.0
vidvid-app-commonvid1.0.0

Projects with a filebeat container as of 20170114

Code Block
ubuntu@ip-172-31-49-200:~$ kubectl get pods --all-namespaces | grep 2/2
onap-aai              aai-resources-1039856271-3ph1d                2/2       Running        0          37m
onap-aai              aai-traversal-143081090-f4cls                 2/2       Running        0          37m
onap-aai              model-loader-service-4144225433-0jr21         2/2       Running        0          37m
onap-aai              search-data-service-3842430948-53j1w          2/2       Running        0          37m
onap-aai              sparky-be-4222608366-966p4                    2/2       Running        0          37m
onap-appc             appc-1828810488-mhsf7                         2/2       Running        0          37m
onap-mso              mso-736294529-c2p8v                           2/2       Running        0          37m
onap-policy           drools-2600956298-dp7bq                       2/2       Running        0          37m
onap-policy           pap-466625067-n23bp                           2/2       Running        0          37m
onap-policy           pdp-2354817903-kmxv5                          2/2       Running        0          37m
onap-portal           portalapps-1783099045-79lcq                   2/2       Running        0          37m
onap-sdc              sdc-be-2336519847-p6p5l

...

<eelf.version>1.0.0
</eelf.version>

...

Projects with a filebeat container as of 20170114

Code Block
ubuntu@ip-172-31-49-200:~$ kubectl get pods --all-namespaces | grep 2/2
onap-aai              aai-resources-1039856271-3ph1d                2/2       Running        0          37m
onap-aaisdc              aaisdc-traversalfe-143081090-f4cls2862673798-xcpnk                       2/2       Running        0          37m
onap-aaisdnc              model-loader-service-4144225433-0jr21sdnc-0         2/2       Running        0          37m
onap-aai      2/2        search-data-service-3842430948-53j1wRunning        0   2/2       Running37m
onap-sdnc        0          37m
onap-aaisdnc-dbhost-0              sparky-be-4222608366-966p4                    2/2       Running        0          37m
onap-appcvid              appcvid-1828810488-mhsf7  server-3026751708-rpmq4                       2/2       Running        0          37m
onap-mso              mso-736294529-c2p8v                           2/2       Running        0          37m
onap-policy           drools-2600956298-dp7bq                       2/2       Running        0          37m
onap-policy           pap-466625067-n23bp                           2/2       Running        0          37m
onap-policy           pdp-2354817903-kmxv5                          2/2       Running        0          37m
onap-portal           portalapps-1783099045-79lcq                   2/2       Running        0          37m
onap-sdc              sdc-be-2336519847-p6p5l                       2/2       Running        0          37m
onap-sdc              sdc-fe-2862673798-xcpnk                       2/2       Running        0          37m
onap-sdnc             sdnc-0                                        2/2       Running        0          37m
onap-sdnc             sdnc-dbhost-0                 

Current Logging Libraries

Current Framework usage impacting Logging

Logging in VNFs

Deploying the RI

WIP

Kubernetes deployment of the RI

Code Block


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

Code Block
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: 2/2       Running
remote:   https://gerrit.onap.org/r/27195 Initial logging  lib/demo 0proj struct        
remote: 37m
onap-vid   
To ssh://gerrit.onap.org:29418/logging-analytics
 * [new branch]      HEAD     vid-server-3026751708-rpmq4                   2/2       Running        0          37m-> 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

Code Block
	<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


DI 3: 20171231: Audit: Mixed version of EELF dependency

...

https://en.wikipedia.org/wiki/HTTP_ETag

DI 5: 20170120: Docker wrapper of Logging Library

Jira
serverONAP JIRA
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyLOG-136

Implementation


Testing

http://127.0.0.1:8080/logging-demo/rest/read/test

...