Viewing and working with logs generated by your application

Prerequisite

Review Application Code Logging

Monitor Container Log with Developer Console

  • go to web terminal
  • test call backend service
    BACKEND_URL=https://$(oc get route backend -o jsonpath='{.spec.host}')
    curl $BACKEND_URL/backend
    
  • view log in pod, go to Topology, click Duke icon (backend), in backend deployment select Resources Tab, click 'View logs' of Pod
  • in pod details, select Logs tab to view log of container 'backend'
  • re call backend service and check log in pod append (retry call 2-3 times for view logs append)
      BACKEND_URL=https://$(oc get route backend -o jsonpath='{.spec.host}')
      curl $BACKEND_URL/backend
    
    check log append at log terminal
  • click raw icon to view log in another browser tab
  • click download to download currnet log

Monitor Container Log with EFK Stack in Openshift

  • From Logs tab in Pod details, click show in Kibana icon to open kibana in new tab
  • Optional: for firstime, openshift will request you re-login and allow authorized to kibana (with oauth), click allow selected permissions
  • Openshift will Open Kibana from EFK Stack, default page is Discover and auto add filter with pod name, namespace/project and container name
  • Developer can custom filter to view log.
  • For monitor more than 1 pod, developer can access kibana from logging menu on top of Developer Console (near web terminal menu icon)
  • with this link, developer can custom filter to view log.

Next Step

results matching ""

    No results matching ""