HCL Commerce Version 9.0.0.0HCL Commerce Version 9.0.0.1 onlyHCL Commerce Version 9.0.0.2

Persisting logs to a central log storage location (Version 9.0.0.2 or earlier)

By persisting log files to a central location outside of the Docker containers, you can perform diagnostics and troubleshoot issues even if the container is not accessible or is destroyed.

Procedure

  1. Create folders on the Docker host machine to store the log files. It is recommended that you create one folder for each container.
    For example, assuming that you have two Transaction server Docker containers, two Web server Docker containers, two Search server Docker containers, two Store server Docker containers, one Customization server Docker container, and one Utility server Docker container, create the following folders.
    • /logs/TS_<containername1>_log
    • /logs/TS_<containername2>_log
    • /logs/WEB_<containername1>_log
    • /logs/WEB_<containername2>_log
    • /logs/SEARCH_<containername1>_log
    • /logs/SEARCH_<containername2>_log
    • /logs/STORE_<containername1>_log
    • /logs/STORE_<containername2>_log
    • /logs/XC_<containername>_log
    • /logs/UTILS_<containername>_log
  2. Configure your Docker containers to start with a volume mount to the corresponding directories in the Docker host machine.
    For example, if you are using Docker Compose, edit the Compose file to add the volumes flag. The following examples provide the paths to where the logs are generated in each container.
    • For Transaction server Docker container,
      volumes:
          -"/logs/TS_<containername1>_log:/opt/WebSphere/AppServer/profiles/default/logs"
      Note: Javacore and heapdump logs are output to the /opt/WebSphere/AppServer/profiles/default directory.
    • For Web server Docker container,
      volumes:
          - "/logs/WEB_<containername1>_log1:/opt/WebSphere/HTTPServer/logs"
    • For Search server Docker container,
      volumes:
          -"/logs/SEARCH_<containername1>_log:/opt/WebSphere/Liberty/usr/servers/default/logs"
      The /opt/WebSphere/Liberty/usr/servers/default/logs directory also links to the /profile/logs directory in the container.
    • For Store server Docker container,
      volumes:
          -"/logs/STORE_<containername1>_log:/opt/WebSphere/Liberty/usr/servers/default/logs"
      The /opt/WebSphere/Liberty/usr/servers/default/logs directory also links to the /profile/logs directory in the container.
    • For Customization server Docker container,
      volumes:
          -"/logs/XC_<containername>_log:/opt/WebSphere/Liberty/usr/servers/default/logs"
    • For Utility server Docker container,
      volumes:
          -"/logs/UTILS_<containername>_log:/opt/WebSphere/CommerceServer90/logs"
          -"/logs/UTILS_<containername>_log:/opt/WebSphere/CommerceServer90/instances/demo/logs"
    For more information, see
  3. Deploy containers by using the updated Docker Compose file.