File tree 2 files changed +12
-6
lines changed
AspNetCoreModuleV2/CommonLib
IIS/test/Common.FunctionalTests 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ void SetDebugFlags(const std::wstring &debugValue)
123
123
}
124
124
}
125
125
126
- bool CreateDebugLogFile (const std::wstring &debugOutputFile)
126
+ bool CreateDebugLogFile (const std::filesystem::path &debugOutputFile)
127
127
{
128
128
try
129
129
{
@@ -140,6 +140,11 @@ bool CreateDebugLogFile(const std::wstring &debugOutputFile)
140
140
CloseHandle (g_logFile);
141
141
g_logFile = INVALID_HANDLE_VALUE;
142
142
}
143
+
144
+ // ignore errors
145
+ std::error_code ec;
146
+ create_directories (debugOutputFile.parent_path (), ec);
147
+
143
148
g_logFile = CreateFileW (debugOutputFile.c_str (),
144
149
(GENERIC_READ | GENERIC_WRITE),
145
150
(FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE),
@@ -348,13 +353,13 @@ DebugPrintW(
348
353
WORD eventType;
349
354
switch (dwFlag)
350
355
{
351
- case ASPNETCORE_DEBUG_FLAG_ERROR:
356
+ case ASPNETCORE_DEBUG_FLAG_ERROR:
352
357
eventType = EVENTLOG_ERROR_TYPE;
353
358
break ;
354
- case ASPNETCORE_DEBUG_FLAG_WARNING:
359
+ case ASPNETCORE_DEBUG_FLAG_WARNING:
355
360
eventType = EVENTLOG_WARNING_TYPE;
356
361
break ;
357
- default :
362
+ default :
358
363
eventType = EVENTLOG_INFORMATION_TYPE;
359
364
break ;
360
365
}
Original file line number Diff line number Diff line change @@ -85,17 +85,18 @@ public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant)
85
85
86
86
[ ConditionalTheory ]
87
87
[ MemberData ( nameof ( TestVariants ) ) ]
88
+ [ RequiresNewShim ]
88
89
public async Task StartupMessagesAreLoggedIntoDebugLogFile ( TestVariant variant )
89
90
{
90
91
var deploymentParameters = _fixture . GetBaseDeploymentParameters ( variant , publish : true ) ;
91
92
deploymentParameters . HandlerSettings [ "debugLevel" ] = "file" ;
92
- deploymentParameters . HandlerSettings [ "debugFile" ] = "debug.txt" ;
93
+ deploymentParameters . HandlerSettings [ "debugFile" ] = "subdirectory \\ debug.txt" ;
93
94
94
95
var deploymentResult = await DeployAsync ( deploymentParameters ) ;
95
96
96
97
await deploymentResult . HttpClient . GetAsync ( "/" ) ;
97
98
98
- AssertLogs ( Path . Combine ( deploymentResult . ContentRoot , "debug.txt" ) ) ;
99
+ AssertLogs ( Path . Combine ( deploymentResult . ContentRoot , "subdirectory" , " debug.txt") ) ;
99
100
}
100
101
101
102
[ ConditionalTheory ]
You can’t perform that action at this time.
0 commit comments