public void Configuration(IAppBuilder app) { //Configure the hub with dependency injection. (Use IOC container, not like this..) GlobalHost.DependencyResolver.Register( typeof(DemoHub), () => new DemoHub(new DemoHubProxy(new ResonanceHubMemoryRepository <DemoServiceInformation>()))); GlobalHost.DependencyResolver.Register(typeof(LoggingHub), () => new LoggingHub()); app.UseCors(CorsOptions.AllowAll); app.MapSignalR(new HubConfiguration() { EnableDetailedErrors = true //Include exception messages from hub! }); GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = null; //Unlimited message size. GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(10); //Optional, configure the reconnection timeout (minimum 6 seconds). LoggingConfiguration.ConfigureLogging(); LoggingConfiguration.LogReceived += (x, e) => { LoggingHub.PublishLog(e); }; }
public static void Main(string[] args) { var configuration = GetConfiguration(); LoggingConfiguration.ConfigureLogging(configuration); CreateHost(args); }
public static void Main(string[] args) { IConfiguration configuration = GetConfiguration(); LoggingConfiguration.ConfigureLogging(configuration); Log.Information("DBMigration.Service has been initialized."); new GraphDataMigrator(configuration).Migrate(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { LoggingConfiguration.ConfigureLogging(app, env, loggerFactory, Configuration); app.UseAuthentication(); SwaggerConfiguration.AddSwagger(app); CorsConfiguration.UseCors(app); if (!env.IsDevelopment()) { var context = app.ApplicationServices.GetService <PgsKanbanContext>(); context.Database.Migrate(); } SignalRConfiguration.UseSignalR(app); app.UseMvc(); }
// This code configures Web API. The Startup class is specified as a type // parameter in the WebApp.Start method. public void Configuration(IAppBuilder appBuilder) { // Configure Web API for self-host. HttpConfiguration config = new HttpConfiguration(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); appBuilder.UseWebApi(config); var fileSystem = new PhysicalFileSystem("."); var options = new FileServerOptions { EnableDefaultFiles = true, FileSystem = fileSystem }; appBuilder.UseFileServer(options); //Configure the hub with dependency injection. (Use IOC container, not like this..) GlobalHost.DependencyResolver.Register( typeof(DemoHub), () => new DemoHub(new DemoHubProxy(new ResonanceHubMemoryRepository <DemoServiceInformation>()))); GlobalHost.DependencyResolver.Register(typeof(LoggingHub), () => new LoggingHub()); appBuilder.UseCors(CorsOptions.AllowAll); appBuilder.MapSignalR(new HubConfiguration() { EnableDetailedErrors = true //Include exception messages from hub! }); GlobalHost.Configuration.MaxIncomingWebSocketMessageSize = null; //Unlimited message size. LoggingConfiguration.ConfigureLogging(); LoggingConfiguration.LogReceived += (x, e) => { LoggingHub.PublishLog(e); }; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); LoggingConfiguration.ConfigureLogging(); }
protected override void OnStart() { LoggingConfiguration.ConfigureLogging(); }