Uploaded image for project: 'Ansible Automation Platform RFEs'
  1. Ansible Automation Platform RFEs
  2. AAPRFE-2643

Add a feature to redirect Containerized installation logs in to the file.

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      1. What is the nature and description of the request?
        > Add a feature to redirect Containerized installation logs in to the file. User want to capture logs of specific containers in file to be used with the logging tool.
      2. Why does the customer need this? (List the business requirements here)
        > User wants to capture logs in a file and use that file for external logging tool.
      3. How would you like to achieve this? (List the functional requirements here)
        > Need an option to capute the logs in container specific files. For example, If I want to capture the `automation-hub-api` logs, I'll configure path something similar to `/var/log/pods/automation-hub/automation-hub-api.log'

      Additional Info

      I tried setting the log_driver and log_path in global configuration as follows but its not working.

      # vi /etc/containers/containers.conf
      ---
      
      [engine]
      runtime = "crun"
      
      [containers]
      log_driver = "k8s-file"
      log_path = "/var/log/pods"

      Then I restarted all the pods, but podman inspect still isn't showing the correct path.

      `# podman inspect automation-controller-task" still shows journald as the log.`

      "LogConfig": {
      "Type": "journald",
      "Config": null,
      "Path": "",
      "Tag": "",
      "Size": "0B"
      

       

      But podman info is showing the correct logdriver

      $ podman info | grep -i log
      eventLogger: journald
      logDriver: k8s-file
      log:

       

      I also tried in $HOME/.config/containers/containers.conf but no luck

      #cat $HOME/.config/containers/containers.conf
      ---
      [engine]
      runtime = "crun"
      [containers]
      log_driver = "k8s-file"
      log_path = "/var/log/pods/automation-hub/automation-hub-api.log"
      
      $ podman info | grep -i log
      eventLogger: journald
      logDriver: k8s-file
      log: 

              Unassigned Unassigned
              rhn-support-pghadge Prakash Ghadge
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: