Add articles on logging and progress (#717)
* Add articles on logging and progress * Address comments in PR review
This commit is contained in:
parent
52b1ed5fac
commit
7cb3a64c06
1 changed files with 629 additions and 5 deletions
22
docs/concepts/progress/samples/server/Program.cs
Normal file
22
docs/concepts/progress/samples/server/Program.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Progress.Tools;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddMcpServer()
|
||||
.WithHttpTransport()
|
||||
.WithTools<LongRunningTools>();
|
||||
|
||||
builder.Logging.AddConsole(options =>
|
||||
{
|
||||
options.LogToStandardErrorThreshold = LogLevel.Information;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.MapMcp();
|
||||
|
||||
app.Run();
|
||||
Loading…
Reference in a new issue