Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an aspire logs [resource resource] command #8069

Open
mitchdenny opened this issue Mar 14, 2025 · 1 comment
Open

Add an aspire logs [resource resource] command #8069

mitchdenny opened this issue Mar 14, 2025 · 1 comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@mitchdenny
Copy link
Member

We would like the ability for developers, using the aspire CLI to be able to execute aspire logs [resource name]. This would result in the logs that would normally appear in the dashboard appearing in the console log.

The problem we need to solve is how does aspire logs [resource name] identify and connect to the apphost which is managing the resource.

At the moment we have an RPC mechanism where the aspire CLI itself listens of a connection on a unix socket (the apphost initiates the connection). Should we reverse the handshake here and connect the other way? Should each app host create a socket in a well known path which the CLI can use the find the right apphost?

What security concerns are there here?

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 14, 2025
@mitchdenny
Copy link
Member Author

One thing we could do is have the AppHost write a file in a well known directory with metadata that the CLI can use. That metadata would have information such as where the project file is located, and what the path to the socket is.

If there are multiple apphosts running at once, then the CLI could actually prompt the user to ask which one to connect to (show the csproj path and the PID).

This could actually be useful for testing scenarios as well because if you have a hung test, you could use the aspire CLI to inspect the state (and DevKit extension / VS / other IDEs could enrich the experience too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

1 participant