7 User Logs
The CNCC logs following user actions:
- Login: This log contains information about the users who are logged in to the system and their assigned roles.
- NF Resource Access: This log contains information about the name of the users who are accessing the resource and and their assigned roles.
- Logout: This log contains information about the users who are logged out from the system.
Log Details
Table 7-1 Log Details
Name | Description | Example |
---|---|---|
thread | Name of the thread | "thread": "reactor-http-epoll-1" |
level | Level of the log. It can be: Log level (INFO, WARN, DEBUG, TRACE) | "level": "INFO" |
loggerName | Name of the class that generated the log | "loggerName": "ocpm.cne.gateway.cncc.config.CustomAuthenticationSuccessHandler" |
message | Information about the event | "message": "Login successful -- UserName: jon" |
instant | The Date and Time the event occurred in epoch second and nano seconds | "instant": { "epochSecond": 1590045388, "nanoOfSecond": 339789000} |
processId | Linux process Identifier (for a multi-process host) | Linux process Identifier (for a multi-process host). |
threadId | Id of the thread | "threadId":"43" |
threadPriority | Priority assigned to the thread | "threadPriority": 5 |
pod | Name of the pods where the log is generated | "cncc-core-ingress-gateway-77df795fb5-wv2sb" |
contextMap | Information about host-name and transaction-id | "contextMap": { "hostname": "cncc-core-ingress-gateway-77df795fb5-wv2sb", "ingressTxId": "ingress-tx-1460885598"} |
Log Format
The format of log is as follows:
{
"thread": <threadId>,
"level": <log_level>,
"loggerName": <name_of_the_class>,
"message": <message>,
"instant": <timestamp_in_miliseconds>,
"threadId": <threadId>,
"threadPriority": <threadPriority>,
"pod": <name_of_the_pod>,
"processId": <processId>,
"contextMap": <context_map>
}
Log Examples
User Login Example:
{
"thread": "reactor-http-epoll-1",
"level": "INFO",
"loggerName": "ocpm.cne.gateway.cncc.config.CustomAuthenticationSuccessHandler",
"message": "Login successful -- UserName: shreb, Roles: [\"PCF_WRITE\",\"CONVERGED_READ\",\"CONVERGED_WRITE\",\"UDR_READ\",\"POLICY_READ\",\"PCF_READ\",\"SCP_READ\",\"UDR_WRITE\",\"CNPCRF_WRITE\",\"NRF_WRITE\",\"ADMIN\",\"POLICY_WRITE\",\"CNPCRF_READ\",\"NRF_READ\",\"SCP_WRITE\"]",
"endOfBatch": false,
"loggerFqcn": "org.apache.logging.log4j.spi.AbstractLogger",
"instant": {
"epochSecond": 1590045098,
"nanoOfSecond": 143345000
},
"contextMap": {},
"threadId": 43,
"threadPriority": 5,
"processId": "1",
"instanceType": "prod"
}
{
"thread": "reactor-http-epoll-1",
"level": "INFO",
"loggerName": "ocpm.cne.gateway.cncc.config.CustomAuthenticationSuccessHandler",
"message": "Session timeoutPT30M , Session ID : c9fdf0d5-0676-4489-9685-3122f2e77568",
"endOfBatch": false,
"loggerFqcn": "org.apache.logging.log4j.spi.AbstractLogger",
"instant": {
"epochSecond": 1590045356,
"nanoOfSecond": 575067000
},
"contextMap": {
"hostname": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"ingressTxId": "ingress-tx-1460885598"
},
"threadId": 43,
"pod": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"threadPriority": 5,
"processId": "1",
"instanceType": "prod",
"ingressTxId": "ingress-tx-1460885598"
}
User NF Resource Access Example:
{
"thread": "reactor-http-epoll-2",
"level": "INFO",
"loggerName": "ocpm.cne.gateway.cncc.config.RolesBasedAuthorizationDecision",
"message": "User Authorization Details -- UserName: shreb, Roles: [\"PCF_WRITE\",\"CONVERGED_READ\",\"CONVERGED_WRITE\",\"UDR_READ\",\"POLICY_READ\",\"PCF_READ\",\"SCP_READ\",\"UDR_WRITE\",\"CNPCRF_WRITE\",\"NRF_WRITE\",\"ADMIN\",\"POLICY_WRITE\",\"CNPCRF_READ\",\"NRF_READ\",\"SCP_WRITE\"]",
"endOfBatch": false,
"loggerFqcn": "org.apache.logging.log4j.spi.AbstractLogger",
"instant": {
"epochSecond": 1590045388,
"nanoOfSecond": 339789000
},
"contextMap": {
"hostname": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"ingressTxId": "ingress-tx-175723908"
},
"threadId": 56,
"threadPriority": 5,
"pod": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"processId": "1",
"instanceType": "prod",
"ingressTxId": "ingress-tx-175723908"
}
User Logout Example:
{
"thread": "reactor-http-epoll-2",
"level": "INFO",
"loggerName": "ocpm.cne.gateway.cncc.config.CustomServerLogoutSuccessHandler",
"message": "Logout successful -- UserName: shreb",
"endOfBatch": false,
"loggerFqcn": "org.apache.logging.log4j.spi.AbstractLogger",
"instant": {
"epochSecond": 1590045260,
"nanoOfSecond": 379367000
},
"contextMap": {
"hostname": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"ingressTxId": "ingress-tx-1989016497"
},
"threadId": 56,
"threadPriority": 5,
"pod": "cncc-core-ingress-gateway-77df795fb5-wv2sb",
"processId": "1",
"instanceType": "prod",
"ingressTxId": "ingress-tx-1989016497"
}
Accessing the Logs
CNCC application logs can be accessed using any one of following options:
Using Command:
- Execute the following commad to view the logs of a running CNCC application pod:
kubectl logs -f -n <cncc_namespace> <pod_name> -c
<container_name>
Example: kubectl logs -f -n cncc
cncc-core-ingress-gateway-77df795fb5-wv2sb -c ingress-gateway
Using Logging Framework:
- View logs using cloud native supported logging framework: Example : EFK (Elasticsearch, Fluentd and Kibana) can be used with CNCC to view the logs.