From 7a2c23b3ad83eab0eed5b990c70a1603447d5ee5 Mon Sep 17 00:00:00 2001 From: "Singla, Rajiv (rs153v)" Date: Wed, 15 Aug 2018 11:46:10 -0400 Subject: Standalone TCA with EELF Logger Issue-ID: DCAEGEN2-633 Change-Id: I4da76b532021c0d6248455e7bd6e77f4614c35a7 Signed-off-by: Singla, Rajiv (rs153v) --- .../utils/eelf/logger/api/info/AppLogInfo.java | 101 +++++++++++++++++++++ .../utils/eelf/logger/api/info/CodeLogInfo.java | 55 +++++++++++ .../eelf/logger/api/info/CustomFieldsLogInfo.java | 62 +++++++++++++ .../utils/eelf/logger/api/info/ErrorLogInfo.java | 76 ++++++++++++++++ .../dcae/utils/eelf/logger/api/info/LogInfo.java | 30 ++++++ .../eelf/logger/api/info/LogLevelCategory.java | 36 ++++++++ .../utils/eelf/logger/api/info/MessageLogInfo.java | 62 +++++++++++++ .../utils/eelf/logger/api/info/MiscLogInfo.java | 45 +++++++++ .../eelf/logger/api/info/NagiosAlertLevel.java | 52 +++++++++++ .../eelf/logger/api/info/RequestIdLogInfo.java | 44 +++++++++ .../eelf/logger/api/info/RequestStatusCode.java | 32 +++++++ .../eelf/logger/api/info/RequestTimingLogInfo.java | 64 +++++++++++++ .../eelf/logger/api/info/ResponseLogInfo.java | 81 +++++++++++++++++ .../utils/eelf/logger/api/info/ServiceLogInfo.java | 61 +++++++++++++ .../eelf/logger/api/info/TargetServiceLogInfo.java | 54 +++++++++++ .../utils/eelf/logger/api/info/package-info.java | 28 ++++++ 16 files changed, 883 insertions(+) create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/AppLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CodeLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CustomFieldsLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ErrorLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogLevelCategory.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MessageLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MiscLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/NagiosAlertLevel.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestIdLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestStatusCode.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestTimingLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ResponseLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ServiceLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/TargetServiceLogInfo.java create mode 100644 eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/package-info.java (limited to 'eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info') diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/AppLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/AppLogInfo.java new file mode 100644 index 0000000..bdce8d1 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/AppLogInfo.java @@ -0,0 +1,101 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures information about application which is doing the logging. All app log fields must remain same for + * the whole duration of the application once its instance is created. + * + * @author Rajiv Singla + */ +public interface AppLogInfo extends LogInfo { + + /** + * Required field contains UUID which identifies this service instance inside an inventory management system + * (e.g. A&AI) to reference/manage this service as a unit + * + * @return remote VM Name or service the request is acting upon. + */ + String getServiceInstanceID(); + + /** + * Required field contains a universally unique identifier used to differentiate between multiple instances of + * the same (named), log writing service/application. Its value is set at instance creation time (and read by it, + * e.g. at start/initialization time from the environment). This value should be picked up by the component + * instance from its configuration file and subsequently used to enable differentiating log records created by + * multiple, locally load balanced EELF component or sub component instances that are otherwise identically + * configured. + * + * @return instance UUID + */ + String getInstanceUUID(); + + /** + * Optional field contains VM Name where app is deployed. + * DCAE sub components should populate this field but it can be empty if + * determined that its value can be added by the log files collecting agent itself (e.g. Splunk). + *

+ * Example: host.vm.name.com + *

+ * + * @return virtual server name + */ + String getVirtualServerName(); + + /** + * Optional field contains the logging component host server’s IP address. + *

+ * Example: 127.0.0.100 + *

+ * + * @return server ip address + */ + String getServerIPAddress(); + + /** + * Required field for VM's fully qualified domain name or hosting machine fully qualified domain name. + *

+ * Example: host.fqdn.com + *

+ * + * @return server host fully qualified domain name + */ + String getServerFQDN(); + + + /** + * Contains default values for {@link AppLogInfo} + */ + interface Defaults { + + String DEFAULT_SERVICE_INSTANCE_ID = "UNKNOWN_INSTANCE_ID"; + + String DEFAULT_INSTANCE_UUID = ""; + + String DEFAULT_VIRTUAL_SERVER_NAME = ""; + + String DEFAULT_SERVER_IP_ADDRESS = "UNKNOWN_IP_ADDRESS"; + + String DEFAULT_SERVER_FQDN = "UNKNOWN_SERVER_FQDN"; + + } + + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CodeLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CodeLogInfo.java new file mode 100644 index 0000000..bea195d --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CodeLogInfo.java @@ -0,0 +1,55 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Capture field required to log details about code which is generating the log message. + *

+ * NOTE: When using a logging framework(e.g. logback) implementation these fields may be automatically deduced - so + * settings these fields is not required by the application and even if application sets these fields the logging + * framework may ignore it + * + *

+ * + * @author Rajiv Singla + */ +public interface CodeLogInfo extends LogInfo { + + + /** + * Optional field used if wanting to trace processing of a request over a number of sub-components of a single EELF + * component. It should be preceded by a log record that establishes its chaining back to the corresponding + * requestID. + * + * @return thread ID used to trace processing of request over number of sub-components of single EELF Component. + */ + String getThreadId(); + + + /** + * Optional field: If available for OO programing languages that support this concept. This is the name of the + * class that has caused the log record to be created. + * + * @return name of the class that has the caused the log record to be created + */ + String getClassName(); + + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CustomFieldsLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CustomFieldsLogInfo.java new file mode 100644 index 0000000..634afa6 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/CustomFieldsLogInfo.java @@ -0,0 +1,62 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures fields required to log Custom fields + * + * @author Rajiv Singla + */ +public interface CustomFieldsLogInfo extends LogInfo { + + /** + * Optional field that can be used by developers to include additional application-specific + * information to support operations and troubleshooting of the system. + * + * @return additional application-specific information to support operations and troubleshooting of the system. + */ + String getCustomField1(); + + /** + * Optional field that can be used by developers to include additional application-specific + * information to support operations and troubleshooting of the system. + * + * @return additional application-specific information to support operations and troubleshooting of the system. + */ + String getCustomField2(); + + /** + * Optional field that can be used by developers to include additional application-specific + * information to support operations and troubleshooting of the system. + * + * @return additional application-specific information to support operations and troubleshooting of the system. + */ + String getCustomField3(); + + /** + * Optional field that can be used by developers to include additional application-specific + * information to support operations and troubleshooting of the system. + * + * @return additional application-specific information to support operations and troubleshooting of the system. + */ + String getCustomField4(); + + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ErrorLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ErrorLogInfo.java new file mode 100644 index 0000000..876037c --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ErrorLogInfo.java @@ -0,0 +1,76 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures fields required to log error related information + * + * @author Rajiv Singla + */ +public interface ErrorLogInfo extends LogInfo { + + + /** + * Required field contains an error code representing the error condition. The codes can be chose by + * the logging application but they should adhere to the guidelines embodied in the table below: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Error typeNotes
100Permission errors
200Availability errors/Timeouts
300Data errors
400Schema errors
500Business process errors
900Unknown Errors
+ * + * @return error Code + */ + Integer getErrorCode(); + + + /** + * Required field contains a human readable description of the error condition. + * + * @return human readable description of the error condition + */ + String getErrorDescription(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogInfo.java new file mode 100644 index 0000000..4a3680f --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogInfo.java @@ -0,0 +1,30 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +import java.io.Serializable; + +/** + * Marker interface for all EELF Logging Information Components + * + * @author Rajiv Singla + */ +public interface LogInfo extends Serializable { +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogLevelCategory.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogLevelCategory.java new file mode 100644 index 0000000..665a280 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/LogLevelCategory.java @@ -0,0 +1,36 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures various logging levels. + * NOTE: Enum ordered signifies low to high log level severity + * + * @author Rajiv Singla + */ +public enum LogLevelCategory implements LogInfo { + + DEBUG, + INFO, + WARN, + ERROR, + FATAL; + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MessageLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MessageLogInfo.java new file mode 100644 index 0000000..cd53ccf --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MessageLogInfo.java @@ -0,0 +1,62 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +import java.util.Date; + +/** + * Captures fields required for message level logging. These fields are mostly derived fields. For example: creation + * timestamp can be auto generated based on system time, {@link RequestStatusCode} and {@link NagiosAlertLevel} can be + * derived based on {@link LogLevelCategory} + * + * @author Rajiv Singla + */ +public interface MessageLogInfo extends LogInfo { + + + /** + * Required field to capture when the message was created + * The value should be represented in UTC and formatted according to ISO 8601. + *

+ * Example: 2015-06-03T13:21:58+00:00 + *

+ * + * @return message creation creationTimestamp + */ + Date getCreationTimestamp(); + + /** + * Required field contains a value of COMPLETE or ERROR to indicate high level success or failure of the + * request related activities. + * + * @return value to indicate high level success or failure of the request related activities + */ + RequestStatusCode getStatusCode(); + + + /** + * Optional field for Nagios monitoring/alerting severity code + * + * @return nagios monitoring/alerting severity code + */ + NagiosAlertLevel getAlertSeverity(); + + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MiscLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MiscLogInfo.java new file mode 100644 index 0000000..bf1e451 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/MiscLogInfo.java @@ -0,0 +1,45 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures optional / deprecated fields that can be populated as per EELF Logging Requirements + * + * @author Rajiv Singla + */ +public interface MiscLogInfo extends LogInfo { + + /** + * Optional field that can can be used to capture the flow of a transaction through the system by + * indicating the components and operations involved in processed. If present, it can be denoted by a comma + * separated list of components and applications. + * + * @return list of comma separated components and operations involved in processing + */ + String getProcessId(); + + /** + * This field is deprecated and should be left empty. + * + * @return deprecated field value - should be empty + */ + String getUnused(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/NagiosAlertLevel.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/NagiosAlertLevel.java new file mode 100644 index 0000000..3da5fc3 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/NagiosAlertLevel.java @@ -0,0 +1,52 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Enum for Nagios monitoring/alerting codes as per table below. + *

+ * + * + * + * + * + * + *
Return CodeService StateHost State
0OKUP
1WARNINGUP or DOWN/UNREACHABLE*
2CRITICALDOWN/UNREACHABLE
3UNKNOWNDOWN/UNREACHABLE
+ * + * @author Rajiv Singla + */ +public enum NagiosAlertLevel implements LogInfo { + + OK("0"), + WARNING("1"), + CRITICAL("2"), + UNKNOWN("3"); + + private String severityCode; + + NagiosAlertLevel(final String severityCode) { + this.severityCode = severityCode; + } + + public String getSeverityCode() { + return severityCode; + } + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestIdLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestIdLogInfo.java new file mode 100644 index 0000000..68d5a17 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestIdLogInfo.java @@ -0,0 +1,44 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures fields required for logging request information + * + * @author Rajiv Singla + */ +public interface RequestIdLogInfo extends LogInfo { + + /** + * Required field containing requestID which uniquely that identifies a single transaction request within the EELF + * platform. Its value is conforms to RFC4122 UUID. The requestID value is passed using a REST API from one + * EELF component to another via HTTP Headers named X-RequestID + *

+ * 724229c0-9945-11e5-bcde-0002a5d5c51b:1234 + *

+ * If receiving a composite requestID value, e.g. something of the form UUID-1:UUID-2, the receiving component + * should only use the UUID-1 portion (i.e. remove the “:” and any trailing suffix, e.g. UUID-2) as the requestID + * field value for its log files. + * + * @return requestID which uniquely that identifies a single transaction request within the EELF + */ + String getRequestId(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestStatusCode.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestStatusCode.java new file mode 100644 index 0000000..b022b80 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestStatusCode.java @@ -0,0 +1,32 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Enum to indicate high level success or failure of the request related activities + * + * @author Rajiv Singla + */ +public enum RequestStatusCode { + + ERROR, + COMPLETE; + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestTimingLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestTimingLogInfo.java new file mode 100644 index 0000000..7448e69 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/RequestTimingLogInfo.java @@ -0,0 +1,64 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +import java.util.Date; + +/** + * Captures Logging fields required for request timing related information + * + * @author Rajiv Singla + */ +public interface RequestTimingLogInfo extends LogInfo { + + /** + * Required field containing creationTimestamp when the request processing started. + * The value should be represented in UTC and formatted according to ISO 8601. + *

+ * Example: 2015-06-03T13:21:58+00:00 + *

+ * + * @return request activity begin creationTimestamp + */ + Date getBeginTimestamp(); + + + /** + * Required field containing creationTimestamp when the request processed stopped. + * The value should be represented in UTC and formatted according to ISO 8601. + *

+ * Example: 2015-06-03T13:21:58+00:00 + *

+ * + * @return request activity end creationTimestamp + */ + Date getEndTimestamp(); + + + /** + * Required field contains the elapsed time to complete processing of an API call or transaction request (e.g., + * processing of a message that was received). This value should be the difference between EndTimestamp and + * BeginTimestamp fields and should be expressed in milliseconds. + * + * @return request processing elapsed time in milliseconds + */ + Long getElapsedTime(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ResponseLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ResponseLogInfo.java new file mode 100644 index 0000000..1929e7f --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ResponseLogInfo.java @@ -0,0 +1,81 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures field required for logging Response information + * + * @author Rajiv Singla + */ +public interface ResponseLogInfo extends LogInfo { + + /** + * Required field contains application-specific response codes. While error codes are + * application-specific, they + * should conform categories mentioned in table below in order to provide consistency + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Error typeNotes
0Success
100Permission errors
200Availability errors/Timeouts
300Data errors
400Schema errors
500Business process errors
900Unknown Errors
+ * + * @return application-specific error code + */ + Integer getResponseCode(); + + + /** + * Required field contains a human readable description of the {@link #getResponseCode()}. + * + * @return human readable description of the response code + */ + String getResponseDescription(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ServiceLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ServiceLogInfo.java new file mode 100644 index 0000000..0287cef --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/ServiceLogInfo.java @@ -0,0 +1,61 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures information about logging fields for application acting as service and handling requests from other + * applications + * + * @author Rajiv Singla + */ +public interface ServiceLogInfo extends LogInfo { + + /** + * Required field contains the developer given name of the ecomp component's exposed api (~='method', function') + * invoked. For example if the application is exposing a REST interface and exposing runtime metrics then the + * service name can be: appName-getMetrics + * + * @return name of the API invoked by the application + */ + String getServiceName(); + + + /** + * Optional field contains the name of the client or user invoking the service. + * It may be an application, user name or mech id. + * + * @return name of the client or user invoking the API if known + */ + String getPartnerName(); + + + /** + * Optional field contains requesting remote client application’s IP address. Use UNKNOWN or an empty string if not + * available. + * + * @return remote client application’s IP address + */ + String getClientIPAddress(); + + +} + + + diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/TargetServiceLogInfo.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/TargetServiceLogInfo.java new file mode 100644 index 0000000..d9b1f98 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/TargetServiceLogInfo.java @@ -0,0 +1,54 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.dcae.utils.eelf.logger.api.info; + +/** + * Captures fields for logging application which is calling an external/target service + * + * @author Rajiv Singla + */ +public interface TargetServiceLogInfo extends LogInfo { + + /** + * Required field containing name of EELF component/sub component or non-EELF entity which is invoked by the + * logging application + * + * @return target entity name which is invoked by the logging application + */ + String getTargetEntity(); + + + /** + * Required field containing name of External API/operation activities invoked on {@link #getTargetEntity()} + * + * @return target service name invoked by the logging application + */ + String getTargetServiceName(); + + + /** + * Optional field containing target VNF or VM being acted upon by the logging application. This field contains the + * virtual entity that is the target of the action for example the FQDN of the target virtual entity + * + * @return target Virtual Entity + */ + String getTargetVirtualEntity(); + +} diff --git a/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/package-info.java b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/package-info.java new file mode 100644 index 0000000..45bddd1 --- /dev/null +++ b/eelf-logger/eelf-logger-api/src/main/java/org/onap/dcae/utils/eelf/logger/api/info/package-info.java @@ -0,0 +1,28 @@ +/* + * ================================================================================ + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +/** + * Captures EELF logging information about various types. + *

+ * The logging information is segregated into various information different types as to their relevance in particular + * cases. + * + * @author Rajiv Singla + */ +package org.onap.dcae.utils.eelf.logger.api.info; -- cgit 1.2.3-korg