Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Reference for the logging standardization effort: Jakarta Best Practice Proposal for Standardized Logging Fields - v2

This requirement outlines that we can use JSON, CSV, or any other delimited format as long as the field names are present.

JSON Output

For DCAE components using log4j as the logger, update the log4j.xml file CONSOLE appender layout accordingly:

...

Once the XML files are updated, you should be able to rebuild the application and see the logs reflected in STDOUT. 


The VES Collector changes to accomplish this goal can be found here: https://gerrit.onap.org/r/c/dcaegen2/collectors/ves/+/132585


String Output

Log4j has the capability of providing these fields in the normal output of just a string too. Here is some documentation on the tags that are available out of the box with log4j: https://logging.apache.org/log4j/2.x/manual/lookups.html https://www.tutorialspoint.com/log4j/log4j_patternlayout.htm


General Notes

These notes are going to be here for extra help navigating the building and testing process to see if your logging changes are working:

  1. You may have to build the project from a subdirectory rather than the base project directory. This CI Management repo will help clarify where each of the projects are building from to better identify the subdirectory you should build from: https://github.com/onap/ci-management/tree/master/jjb/dcaegen2
  2. You will need the onap-settings.xml file to build each project. You can download it here: onap-settings.xml


Misc Resources:

Git Review: Setting Up Your Development Environment#git-review(optional)

ONAP Dev Env Overview: Development Procedures and Policies

Pushing to Gerrit: https://wiki.web.att.com/pages/viewpage.action?spaceKey=DPD&title=Pushing+Code+to+ONAP+Gerrit

Jira Ticket for DCAE logging Specs:

Jira Legacy
serverSystem Jira
serverId4733707d-2057-3a0f-ae5e-4fd8aff50176
keyDCAEGEN2-3257

CPS Logback POC: CPS-986 : Asynchronous Communication Logging

CPS Jira:

Jira Legacy
serverSystem Jira
serverId4733707d-2057-3a0f-ae5e-4fd8aff50176
keyCPS-986

CPS Gerrit: https://gerrit.onap.org/r/c/cps/+/128801/13/cps-service/src/main/resources/logback-spring.xml


List of Application Status with log4j:

Done:

Medium level of effort*:

  • Rest-conf


*- will take longer (and more troubleshooting) than basic changes to the XML files to complete the ask.