Questo contenuto non è disponibile nella lingua selezionata.

Chapter 6. Viewing cluster logs


You can view OpenShift Container Platform cluster logs in the CLI or OpenShift Container Platform web console.

6.1. Viewing cluster logs

You can view cluster logs in the CLI.

Prerequisites

  • Cluster logging and Elasticsearch must be installed.

Procedure

To view cluster logs:

  1. Determine if the log location is a file or CONSOLE (stdout).

    $ oc -n openshift-logging set env daemonset/fluentd --list | grep LOGGING_FILE_PATH
  2. Depending on the log location, execute the logging command:

    • If LOGGING_FILE_PATH points to a file, the default, use the logs utility, from the project, where the pod is located, to print out the contents of Fluentd log files:

      $ oc exec <any-fluentd-pod> -- logs 1
      1
      Specify the name of a log collector pod. Note the space before logs.

      For example:

      $ oc exec fluentd-ht42r -n openshift-logging -- logs
    • If you are using LOGGING_FILE_PATH=console, the log collector writes logs to stdout/stderr`. You can retrieve the logs with the oc logs [-f] <pod_name> command, where the -f is optional.

      $ oc logs -f <any-fluentd-pod> -n openshift-logging 1
      1
      Specify the name of a log collector pod. Use the -f option to follow what is being written into the logs.

      For example

      $ oc logs -f fluentd-ht42r -n openshift-logging

      The contents of log files are printed out.

      By default, Fluentd reads logs from the tail, or end, of the log.

6.2. Viewing cluster logs in the OpenShift Container Platform web console

You can view cluster logs in the OpenShift Container Platform web console .

Prerequisites

  • Cluster logging and Elasticsearch must be installed.

Procedure

To view cluster logs:

  1. In the OpenShift Container Platform console, navigate to Workloads Pods.
  2. Select the openshift-logging project from the drop-down menu.
  3. Click one of the logging collector pods with the fluentd prefix.
  4. Click Logs.

By default, Fluentd reads logs from the tail, or end, of the log.

Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.