How can I view logs from a dead or crashed container in Service Fabric on Linux?

Viewed 484

I have a three-node Service Fabric cluster on Linux which runs Docker containers. When a container is running, I am able to access the logs via Service Fabric Explorer. However, if a container fails, the logs are not visible this way.

The documentation (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-containers-view-logs#access-the-logs-of-a-dead-or-crashed-container) states that it is possible to retrieve logs from a failed container using sfctl. When I try this, it doesn't return any useful information.

As far as I can tell, my ApplicationManifest.xml is configured as per the instructions in the link above. Here is an excerpt of the relevant part:

<ContainerHostPolicies CodePackageRef="code" Isolation="process" ContainersRetentionCount="2" RunInteractive="true">

This is the sfctl command:

sfctl service get-container-logs --node-name _cl10prime_0 --application-id myapp --service-manifest-name myapp-appPkg --code-package-name code --previous

And this is the output from sfctl:

{
  "additionalProperties": {},
  "content": ""
}

The cluster is running Service Fabric version 6.3.124.1.

How can I view the logs from the failed container?

0 Answers
Related