I was recently asked if it is possible to obtain the ID of a container orchestrated by .NET Aspire to monitor its logs. The answer is yes, and in this article, we will see two ways to achieve this by retrieving the logs of an arbitrary MongoDB resource named mongo and displaying them in the console. The first method will be specific to containers, while the second method can be applied to any resource.