You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
535 B
C#
24 lines
535 B
C#
using EntrustSettle.Common;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Serilog;
|
|
|
|
namespace EntrustSettle.Extensions.ServiceExtensions;
|
|
|
|
public static class ApplicationSetup
|
|
{
|
|
public static void UseApplicationSetup(this WebApplication app)
|
|
{
|
|
app.Lifetime.ApplicationStarted.Register(() =>
|
|
{
|
|
App.IsRun = true;
|
|
});
|
|
|
|
app.Lifetime.ApplicationStopped.Register(() =>
|
|
{
|
|
App.IsRun = false;
|
|
|
|
//清除日志
|
|
Log.CloseAndFlush();
|
|
});
|
|
}
|
|
} |