You can retrieve and filter logs from Kubernetes deployments for debugging purposes. Use the following commands to inspect logs in Kubernetes environments:
  • To view recent logs from the deployment, run:
    kubectl logs deploy/oemcp-server -n <ns> --tail=100
    This command retrieves the last 100 log entries from the oemcp-server deployment in the specified namespace. You can use the output to quickly review recent activity and confirm that logs are being generated.
  • To stream logs and filter audit events, run:
    kubectl logs deploy/oemcp-server -n <ns> -f | jq '. | select(.logger=="audit")'
    

    This command streams logs in real time and uses jq to filter entries where the logger is set to "audit". Audit logs provide visibility into tool invocations and rate limiting actions.