10 Using Network Bridge Logging
You can review log files to troubleshoot errors and monitor system activity in your Oracle Communications Network Bridge cloud native system.
Topics in this document:
About Logging
Network Bridge cloud native uses the Apache Log4j2 Java logging utility to log information and errors about the following:
- 
                        
                        Start up and shut down activity. 
- 
                        
                        Interaction with external applications at integration points, including interactions with the ingress controller, 5G Network Function (NF), and 4G Network Element (NE). 
- 
                        
                        Network Manager components: Mediation, HTTP to Diameter Adapter, Diameter Proxy, Diameter to HTTP Adapter, and Egress. 
For general information about Java logging, see Java Platform, Standard Edition Core Libraries. For information about Log4j2, see: https://logging.apache.org/log4j/2.x/manual/index.html.
When you deploy Network Bridge cloud native, logging is automatically set up and running in your Network Bridge cloud native environment with default settings.
- 
                        
                        To access the log files, see "Accessing the Network Bridge Logs". 
- 
                        
                        To change the default Network Bridge logging levels, see "Changing the Log Levels". 
Accessing the Network Bridge Logs
You access the logs by using the kubectl command in the Network Bridge namespace.
To access the logs:
- 
                        Retrieve the names of the Network Bridge pods by entering this command: kubectl -n NBNameSpace get pods where NBNameSpace is the namespace in which Kubernetes objects for the Network Bridge Helm chart reside. The following is an example of the command's output, with the pod names in bold:NAME READY STATUS RESTARTS AGE diameter-adapter-d2h-6f79d95887-lp7qs 1/1 Running 0 6d17h diameter-adapter-h2d-5496bf8d94-vjgn7 1/1 Running 0 6d17h diameter-proxy-d5ccf6dbd-l968b 1/1 Running 0 6d17h diameter-proxy-db-job-22bsg 0/1 Completed 0 7d5h egress-7b974f4488-wx9qz 1/1 Running 0 7d4h mediation-75f9dcd99d-vrrwg 1/1 Running 0 7d4h oc-ccs-ndb-mgmd-0 1/1 Running 0 7d5h oc-ccs-ndb-mgmd-1 1/1 Running 0 7d5h oc-ccs-ndb-mysqld-0 1/1 Running 0 7d5h oc-ccs-ndb-mysqld-1 1/1 Running 0 7d5h oc-ccs-ndb-ndbmtd-0 1/1 Running 0 7d5h oc-ccs-ndb-ndbmtd-1 1/1 Running 0 7d5h
- 
                        
                        Access the logs for a pod by entering this command: kubectl -n NBNameSpace logs PodName For example, to access the mediation logs, you would enter: kubectl -n NBNameSpace logs mediation-75f9dcd99d-vrrwg
The following is an example of the logs for the Mediation component:
2023-11-30T19:53:49,745+00:00 | INFO | | main | .helidon.common.LogConfig | Logging at initialization configured using defaults 2023-11-30T19:53:50,626+00:00 | INFO | | main | iation.factory.KieFactory | Loading rules file from '/app/config/rules' with glob pattern 'glob:/app/config/rules/*.drl' 2023-11-30T19:53:51,030+00:00 | INFO | | main | iation.factory.KieFactory | Adding rules file: '/app/config/rules/pt_n40_to_gy.drl'
Note:
This task shows how to access a single log at a time. To tail logs from multiple pods, Oracle recommends using the Kubernetes Stern tool.
Changing the Log Levels
You can change each Network Bridge component's logging at the root level and the package level to one of the following:
- 
                        
                        TRACE: This log level provides verbose information, including each row loaded into the database. 
- 
                        
                        DEBUG: This log level provides information about the steps for each loading function. 
- 
                        
                        WARN: This log level provides non-critical warnings. 
- 
                        
                        INFO: This log level provides a one-line summary of each file processed. 
- 
                        
                        ERROR: This log level provides only error information. 
To change the log levels for a Network Bridge component:
- 
                        
                        Create an override-values.yaml file for your Network Bridge Helm chart. 
- 
                        
                        To set a component's root-level logging, set the logging.rootLevel key to the desired logging level. 
- 
                        
                        To set a component's package-level logging, set the following keys: - 
                              
                              logging.packageLogging.name: The name of the logging package, such as io.helicon or org.jboss. 
- 
                              
                              logging.packageLogging.level: The logging level, such as TRACE, DEBUG, WARN, INFO, or ERROR. 
 
- 
                              
                              
- 
                        
                        Save and close your override-values.yaml file. 
- 
                        
                        Update your Network Bridge Helm release: helm upgrade NBReleaseName oc-ccs-helm-chart-version --values override-values.yaml -n NBNameSpace
The following shows sample logging settings for the HTTP to Diameter Adapter component:
network-bridge:
   diameter-adapter-h2d:
      protocolTransform:
         logging:
            format:          
               type: TEXT          
               pattern: *loggingPattern        
            rootLevel: DEBUG        
            packageLogging:          
               - name: com.oracle 
                 level: DEBUG          
               - name: io.helidon            
                 level: DEBUG          
               - name: io.jaegertracing.internal.reporters            
                 level: DEBUG