@@ -270,7 +270,7 @@ internal static async Task LogProcessDetailsToFileAsync(this VirtualClientCompon
270
270
( ! string . IsNullOrWhiteSpace ( processDetails . ToolName ) ? processDetails . ToolName : component . TypeName ) . ToLowerInvariant ( ) . RemoveWhitespace ( ) ,
271
271
string . Empty ) ;
272
272
273
- string effectiveCommand = $ "{ processDetails . CommandLine } ". Trim ( ) ;
273
+ string effectiveCommand = $ "{ SensitiveData . ObscureSecrets ( processDetails ? . CommandLine ) } ". Trim ( ) ;
274
274
string logPath = specifics . GetLogsPath ( effectiveToolName . ToLowerInvariant ( ) . RemoveWhitespace ( ) ) ;
275
275
276
276
if ( ! fileSystem . Directory . Exists ( logPath ) )
@@ -314,7 +314,7 @@ internal static async Task LogProcessDetailsToFileAsync(this VirtualClientCompon
314
314
// Any results from the output of the process
315
315
316
316
StringBuilder outputBuilder = new StringBuilder ( ) ;
317
- outputBuilder . AppendLine ( $ "Command : { SensitiveData . ObscureSecrets ( processDetails ? . CommandLine ) } ") ;
317
+ outputBuilder . AppendLine ( $ "Command : { effectiveCommand } ") ;
318
318
outputBuilder . AppendLine ( $ "Working Directory : { processDetails ? . WorkingDirectory } ") ;
319
319
outputBuilder . AppendLine ( $ "Exit Code : { processDetails ? . ExitCode } ") ;
320
320
outputBuilder . AppendLine ( ) ;
@@ -339,6 +339,26 @@ await VirtualClientLoggingExtensions.FileSystemAccessRetryPolicy.ExecuteAsync(as
339
339
{
340
340
await fileSystem . File . WriteAllTextAsync ( logFilePath , outputBuilder . ToString ( ) ) ;
341
341
} ) ;
342
+
343
+ if ( component . TryGetContentStoreManager ( out IBlobManager blobManager ) )
344
+ {
345
+ FileContext fileContext = new FileContext (
346
+ fileSystem . FileInfo . New ( logFilePath ) ,
347
+ HttpContentType . PlainText ,
348
+ Encoding . UTF8 . WebName ,
349
+ component . ExperimentId ,
350
+ component . AgentId ,
351
+ effectiveToolName ,
352
+ component . Scenario ,
353
+ effectiveCommand ,
354
+ component . Roles ? . Any ( ) == true ? string . Join ( ',' , component . Roles ) : null ) ;
355
+
356
+ // The file is already timestamped at this point, so there is no need to add any additional
357
+ // timestamping information.
358
+ FileUploadDescriptor descriptor = component . CreateFileUploadDescriptor ( fileContext , component . Parameters , component . Metadata , timestamped : false ) ;
359
+
360
+ await component . RequestFileUploadAsync ( descriptor ) ;
361
+ }
342
362
}
343
363
}
344
364
catch ( Exception exc )
0 commit comments