File tree Expand file tree Collapse file tree 2 files changed +5
-21
lines changed
Expand file tree Collapse file tree 2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change 3636 builder . UseScheduledTasks ( ) ;
3737} ) ;
3838
39- // Configure console logging
40- builder . Services . AddLogging ( logging =>
41- {
42- logging . AddSimpleConsole ( options =>
43- {
44- options . SingleLine = true ;
45- options . UseUtcTimestamp = true ;
46- options . TimestampFormat = "yyyy-MM-ddTHH:mm:ss.fffZ " ;
47- } ) ;
48- } ) ;
39+ // Configure logging
40+ builder . Services . AddSingleton < ILogger > ( sp => sp . GetRequiredService < ILoggerFactory > ( ) . CreateLogger < Program > ( ) ) ;
41+ builder . Services . AddLogging ( ) ;
4942
5043IHost host = builder . Build ( ) ;
5144await host . StartAsync ( ) ;
Original file line number Diff line number Diff line change 1414string connectionString = builder . Configuration . GetValue < string > ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" )
1515 ?? throw new InvalidOperationException ( "Missing required configuration 'DURABLE_TASK_SCHEDULER_CONNECTION_STRING'" ) ;
1616
17+ builder . Services . AddSingleton < ILogger > ( sp => sp . GetRequiredService < ILoggerFactory > ( ) . CreateLogger < Program > ( ) ) ;
18+ builder . Services . AddLogging ( ) ;
1719// Add all the generated orchestrations and activities automatically
1820builder . Services . AddDurableTaskWorker ( builder =>
1921{
3335 builder . UseScheduledTasks ( ) ;
3436} ) ;
3537
36- // Configure console logging using the simpler, more compact format
37- builder . Services . AddLogging ( logging =>
38- {
39- logging . AddSimpleConsole ( options =>
40- {
41- options . SingleLine = true ;
42- options . UseUtcTimestamp = true ;
43- options . TimestampFormat = "yyyy-MM-ddTHH:mm:ss.fffZ " ;
44- } ) ;
45- } ) ;
46-
4738// Configure the HTTP request pipeline
4839builder . Services . AddControllers ( ) . AddJsonOptions ( options =>
4940{
You can’t perform that action at this time.
0 commit comments