aboutsummaryrefslogtreecommitdiffstats
path: root/common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17Use lombok annotations in IM and ONAP loggingJim Hahn1-30/+15
Issue-ID: POLICY-3394 Change-Id: I25db6b4b13bad8754889eaedb93197cae7d27c4d Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in policy-commonJim Hahn1-16/+16
Fixed sonars: - use "var" instead of actual type name - re-interrupt threads - use rej2 split() instead of String split() Issue-ID: POLICY-3285 Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-29Fix new logger sonars in policy-commonJim Hahn1-18/+18
Not sure if this was introduced with the new logger version, but now seeing a number of new sonars about using "{}". Fixed those. Issue-ID: POLICY-2650 Change-Id: If36b2e89aa9151700bb9cea2906b6afaad5c4c72 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-29upgrade eelf-core dependency: 1.0.0 -> 2.0.0-ossjhh1-4/+4
Issue-ID: POLICY-2387 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I837c2e958a388e8b6f2df2aff9f995359e44ad62
2020-06-18Changes for checkstyle 8.32liamfallon1-5/+5
Issue-ID: POLICY-2188 Change-Id: I00843c61a6567001fc35c3ebb77b6843a1eb7da2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-17Cleanup various sonar issues in policy-commonJim Hahn1-2/+0
Addressed the following issues: - unused imports - unused method parameters - use assertEquals, assertSame instead of assertTrue - provide the parametrized type for this generic Also fixed some checkstyle issues: - removed blank lines between "import" groups Issue-ID: POLICY-2650 Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-11Removing log4j from policy/commonuj426b1-4/+0
Change-Id: Ib662556533f72c99180b611d0a1933f20e231b2c Issue-ID: POLICY-2623 Signed-off-by: uj426b <uj426b@att.com>
2020-04-28Logging enhancement workJoseph Chou1-54/+138
Update log tool to provide placeholder feature Change-Id: I3f2b10d009a1d51f30a6080c07459eb0ac07189f Issue-ID: POLICY-2478 Signed-off-by: Joseph Chou <jc2555@att.com>
2020-04-10Update common-logging for log enhancement workJoseph Chou1-40/+36
Resolve missing error code, add marker/mdc for audit/metrics Change-Id: I490b17aac86f3b63df43e267a5dbe1d1588e5fdf Issue-ID: POLICY-2478 Signed-off-by: Joseph Chou <jc2555@att.com>
2020-04-06Address sonar issues in ONAP-loggingJim Hahn1-3/+1
Addressed the following sonar issues in ONAP-logging: - use Map instead of ConcurrentHashMap - remove unusued fields - use Map.computeIfAbsent() instead of get()/put() pair - readObject is unsafe - use try-with-resources - junit should assert something Also removed some unused imports. Issue-ID: POLICY-2305 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I3480a55da4d0e771f8083c97770a6c9707d871f7 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-01-14Sonar cleanup overrides and fixesPamela Dragosh1-10/+10
Removal of UTF-8 because its already set capabilities doesn't generate any code, no need to include override false positives for passwords etc. override for logging and exception throw that we want add synchronized to overrides that are synchronized ignore checking of some conditions adding synchronized to match set* methods Issue-ID: POLICY-2321 Change-Id: I26d9ca22a0cdd67fdaae9c44b718b8dc103f190e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-07-05Fix sonar issues in policy ONAP loggingJim Hahn1-282/+139
Sonar fixes, other than code coverage. These changes are disruptive and will likely cause breakage in a number of policy repos. Renamed constants. Moved constants/factories from interfaces to classes. Also fixed remaining checkstyle issues, which was equally disruptive, as it required renaming of methods and classes. Split out Onap config properties from EELF config properties, in case changes are made in the future such that Onap properties can no longer subclass from EELF properties (e.g., if EELF properties are converted from a interface to a utility class with a private constructor). Attempted to eliminate some duplicate blocks of code by refactoring out common methods. Change-Id: Ie038d2d4ed553037a9af3f0ddf31baf2b3628fa3 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13More sonar fixes in policy/commonJim Hahn1-55/+59
Note: this does not increase code coverage, but should fix other code issues. Resolved cyclomatic complexity issue in ParameterValidationResult. Refactored duplicate code in GroupValidationResult. Removed IOException from NetworkUtil "throws". Replaced null/empty string tests with StringUtils.isBlank(). Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Added private constructors for utility classes. Removed sleep() from tests. Removed unused parameter from method call. Made some protected methods private. Compute integrity monitor's state-transition table once. Use for-loop instead of iterator. Moved constructors. Fixed some checkstyle issues (tabs => spaces, trailing spaces). Change-Id: I9a962ca45c4ff3f212c6014da799d06f07b232ef Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-03-20Removed checkstyle warningsmmis1-1376/+1449
Removed checkstyle warnings in policy/common/logging Some warnings remain that required renaming of classes and public methods. These will be taken separately Issue-ID: POLICY-695 Change-Id: Id604c66708917de390c556b50f6266f929b09134 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-02-23Added junit tests in ONAP-Loggingmmis1-61/+41
Added junit tests to org.onap.policy.common.logging.eelf package in ONAP-Logging Issue-ID: POLICY-582 Change-Id: Ifca9c38d8b8703b183c25d891d6ed257eb21c91b Signed-off-by: mmis <michael.morris@ericsson.com>
2018-02-20Increase junit coverage in ONAP-loggingJim Hahn1-47/+48
Added some junit tests to increase coverage of ONAP-logger. Many classes still need test cases. Also fixed some sonar issues: Returned interface instead of ConcurrentHashMap. Used EnumMap instead of HashMap. Used StringBuilder instead of StringBuffer. Replaced literals with constants. Replaced enum1.toString().equals(enum2.toString()) with enum1 == enum2 Updated license dates. Updated another license date. Change-Id: I777b6a913d7d03187a29dfeb817800b386ee23aa Issue-ID: POLICY-582 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-12-04Fix sonar issues in ONAP-loggingCharles Cole1-136/+143
Fixed the Sonar issues in ONAP-logging that required minimal refactoring of the code. Many of the System.out and System.err issues I did not fix, as I don't know what loggers to use. Issue-ID: POLICY-458 Change-Id: I8eccb932b350a170b9cd680b90009e6612a0abcd Signed-off-by: Charles Cole <cc847m@att.com>
2017-09-19Remove sonar critical for public staticPamela Dragosh1-9/+49
I think that making these private and using accessor functions we can remove the sonar critical for them. Issue-ID: POLICY-237 Change-Id: I4edbf909935fe17b0ef087b5cd0e384d78d104d6 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-08-04[POLICY-98] Code cleanup for sonar issues.Magnusen, Drew (dm741q)1-64/+28
Modified code in ECOMP-Logging to resolve critical/major sonar issues. Not all issues were resolved as some guidance needs to be provided for specific cases. Restored config/policyLogger.properties file. It was modified by a junit test. Change-Id: I49fee98b2497d9d503d81bbbacbb1b416e1058a7 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-08-01[POLICY-134] Fixed bug in PolicyLogger.Magnusen, Drew (dm741q)1-9/+1
PolicyLogger.info(Object arg0) calls itself recursively until it eventually causes a stack overflow error. Fix is to call debugLogger.info(MessageCodes, String) from within PolicyLogger.info(Object). Additionally, PolicyLogger.info(String arg0) was removed as debugLogger.info(MessageCodes, String) can be called directly. Change-Id: Id141027b544efa06b79f54a6726843b2a47481b9 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-07-31[POLICY-71] replace openecomp for policy-commonGuo Ruijing1-0/+1448
Change-Id: I3241f5d1f0234043b4dff718eda1ffdc48052276 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>