3 Logs
This chapter explains the process to retrieve the logs and status that can be used for effective troubleshooting.
Log Levels
Logs register system events along with their date and time of occurrence. They also provide important details about a chain of events that could have led to an error or problem.
A log level helps in defining the severity level of a log message. For OCNADD, the log level of a microservice can be set to any one of the following valid values:
- TRACE: A log level that describes events, as a step by step execution of code. This can be ignored during the standard operation, but may be useful during extended debugging sessions.
- DEBUG: A log level used for events during software debugging when more granular information is needed.
- INFO: A standard log level indicating that something has happened, an application has entered a certain state, etc.
- WARN: A log level indicates that something unexpected has happened in the application, a problem, or a situation that might disturb one of the processes. But this does not mean that the application has failed. The WARN level should be used in situations that are unexpected, but the code can continue to work.
- ERROR: A log level that should be used when an application hits an issue preventing one or more functionalities from functioning.
Using this information, the logs can be filtered based on the system requirements. For instance, if you want to filter the critical information about your system from the informational log messages, set a filter to view messages with only WARN log level in Kibana.
Configuring Log Levels
To view logging configurations and update logging levels, check the respective service
child values.yaml.
env:
CONFIGURATION_ROOT_LOG_LEVEL: INFO
CONFIGURATION_WEB_LOG_LEVEL: INFOOnce the service child values.yaml is modified, perform helm upgrade for the OCNADD charts.
Collecting Logs
This section describes the steps to collect logs from PODs or containers. Perform the following steps:
- Run the following command to get the POD
details:
$ kubectl -n <namespace_name> get pods - Collect the logs from the specific pods or
containers:
Example:$ kubectl logs <podname> -n <namespace>$ kubectl logs ocnaddconfiguration-xxxxxxxxxx-xxxxx -n ocnadd - Store the log in a file using the following
command:
Example:$ kubectl logs <podname> -n <namespace> > <filename>$ kubectl logs ocnaddconfiguration-xxxxxxxxxx-xxxxx -n ocnadd > logs.txt - (Optional) You can also use the following commands for the log stream with file
redirection starting with the last 100 lines of the
log:
Example:$ kubectl logs <podname> -n <namespace> -f --tail <number of lines> > <filename>$ kubectl logs ocnaddconfiguration-xxxxxxxxxx-xxxxx -n ocnadd -f --tail 100 > logs.txt
For information on the OCNADD GUI user logs, see Oracle Communications Cloud Native Core Console Troubleshooting Guide.