-
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.When running web frontends, it is hard to see errors/reloadings without diving into the resource logs in the dashboard. Especially when monitoring other services, it would be easier to see certain resource logs in the console window of the Aspire.NET process. Describe the solution you'd likeI would like to optionally configure a resource to output their logs to the console window. Maybe add a "LogWriter" option, so we could just pass in "Console.WriteLine" or something. This could also open other possibilities. Not sure what the best option would be here. Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you want all logs forwarded, then enable resource logging when creating the DistributedApplication.CreateBuilder(new DistributedApplicationOptions
{
EnableResourceLogging = true
}) Note this will log output from all resources and may be an explosion of logs interleaved together. If you want more granular control, take a look at the |
Beta Was this translation helpful? Give feedback.
If you want all logs forwarded, then enable resource logging when creating the
DistributedApplication
. Logs are then forwarded to the{hostEnvironment.ApplicationName}.Resources.{resource.Name}
log sourceNote this will log output from all resources and may be an explosion of logs interleaved together. If you want more granular control, take a look at the
ResourceLoggerService.WatchAsync(...)
methods to watch logs and then do whatever you want with them. (e.g. filter then forward to a generic ILogger to show them in the main console.)