FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abp-basic-example/src/Washyn.Web/Program.cs at ExampleBasicRazorPage · washyn/abp-basic-example · GitHub
washyn
abp-basic-example
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
abp-basic-example
/
src
/
Washyn.Web
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
64 lines (60 loc) · 1.84 KB
Breadcrumbs
abp-basic-example
/
src
/
Washyn.Web
/
Program.cs
Copy path
File metadata and controls
64 lines (60 loc) · 1.84 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
System
.
Threading
.
Tasks
;
using
Microsoft
.
AspNetCore
.
Hosting
;
using
Microsoft
.
Extensions
.
Configuration
;
using
Microsoft
.
Extensions
.
Hosting
;
using
Microsoft
.
Extensions
.
Logging
;
using
Serilog
;
using
Serilog
.
Events
;
namespace
Washyn
.
Web
{
public
class
Program
{
public
static
int
Main
(
string
[
]
args
)
{
Log
.
Logger
=
new
LoggerConfiguration
(
)
#if
DEBUG
.
MinimumLevel
.
Debug
(
)
#else
.
MinimumLevel
.
Information
(
)
#endif
.
MinimumLevel
.
Override
(
"Microsoft"
,
LogEventLevel
.
Information
)
.
MinimumLevel
.
Override
(
"Microsoft.EntityFrameworkCore"
,
LogEventLevel
.
Information
)
.
Enrich
.
FromLogContext
(
)
.
WriteTo
.
Async
(
c
=>
c
.
File
(
"Logs/logs.log"
)
)
#if DEBUG
.
WriteTo
.
Async
(
c
=>
c
.
Console
(
)
)
#endif
.
CreateLogger
(
)
;
try
{
Log
.
Information
(
"Starting web host."
)
;
CreateHostBuilder
(
args
)
.
Build
(
)
.
Run
(
)
;
return
0
;
}
catch
(
Exception
e
)
{
Log
.
Fatal
(
e
,
"Host terminated unexpectedly!"
)
;
return
1
;
}
finally
{
Log
.
CloseAndFlush
(
)
;
}
}
public
static
IHostBuilder
CreateHostBuilder
(
string
[
]
args
)
=>
Host
.
CreateDefaultBuilder
(
args
)
.
ConfigureAppConfiguration
(
builder
=>
{
builder
.
AddJsonFile
(
"appsettings.secrets.json"
,
optional
:
true
)
;
}
)
.
ConfigureWebHostDefaults
(
webBuilder
=>
{
webBuilder
.
UseStartup
<
Startup
>
(
)
;
}
)
.
UseAutofac
(
)
.
UseSerilog
(
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL