diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/CommandOptions/OptionsGenerator.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/CommandOptions/OptionsGenerator.cs index 35f48b6cda7..8f0ad59bb8b 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/CommandOptions/OptionsGenerator.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/CommandOptions/OptionsGenerator.cs @@ -50,7 +50,7 @@ public static RootCommand GenerateCommandLineOptions(Func dumpOption.AddAlias("-d"); var universalOption = new Option( - name: "--universalOutput", + name: "--universal", description: "Flag; Redirect all logs to stdout, including what would normally be showing up on stderr.", getDefaultValue: () => false); universalOption.AddAlias("-u"); @@ -83,6 +83,7 @@ public static RootCommand GenerateCommandLineOptions(Func var startCommand = new Command("start", "Start the TestProxy."); startCommand.AddOption(insecureOption); startCommand.AddOption(dumpOption); + startCommand.AddOption(universalOption); startCommand.AddArgument(collectedArgs); startCommand.SetHandler(async (startOpts) => await callback(startOpts), diff --git a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Startup.cs b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Startup.cs index 90d868513bf..b4285640fec 100644 --- a/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Startup.cs +++ b/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Startup.cs @@ -147,10 +147,14 @@ private static void StartServer(StartOptions startOptions) { loggingBuilder.ClearProviders(); loggingBuilder.AddConfiguration(hostBuilder.Configuration.GetSection("Logging")); - loggingBuilder.AddConsole(options => + if (!startOptions.UniversalOutput) { - options.LogToStandardErrorThreshold = startOptions.UniversalOutput ? LogLevel.None : LogLevel.Error; - }).AddSimpleConsole(options => + loggingBuilder.AddConsole(options => + { + options.LogToStandardErrorThreshold = LogLevel.Error; + }); + } + loggingBuilder.AddSimpleConsole(options => { options.TimestampFormat = "[HH:mm:ss] "; });