Skip to content

Commit

Permalink
Change logging category to include TestProxy (#6643)
Browse files Browse the repository at this point in the history
* Change logging category to be TestProxy
* update readme
* add caveat for .NET
  • Loading branch information
JoshLove-msft authored Aug 2, 2023
1 parent 79322c1 commit 173c94c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
using System.Text;
using System.IO;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Json;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Configuration;

namespace Azure.Sdk.Tools.TestProxy.Common
{
Expand Down Expand Up @@ -40,7 +34,7 @@ public static void ConfigureLogger(ILoggerFactory factory)
{
if (Logger == null && factory != null)
{
Logger = factory.CreateLogger("DebugLogging");
Logger = factory.CreateLogger("Azure.Sdk.Tools.TestProxy");
}
}

Expand Down
9 changes: 5 additions & 4 deletions tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,11 @@ test-proxy -- --urls "http://localhost:9000;https://localhost:9001"

The test-proxy is integrated with the following environment variables.

| Variable | Usage |
|---|---|
| `TEST_PROXY_FOLDER` | if command-line argument `storage-location` is not provided when invoking the proxy, this environment variable is also checked for a valid directory to use as test-proxy context. |
| `Logging__LogLevel__Default` | Defaults to `Information`. Possible valid values are `Information`, `Warning`, `Error`, `Critical`. |
| Variable | Usage |
|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `TEST_PROXY_FOLDER` | if command-line argument `storage-location` is not provided when invoking the proxy, this environment variable is also checked for a valid directory to use as test-proxy context. |
| `Logging__LogLevel__Default` | Defaults to `Information`. Possible valid values are <br/><br/>`Debug`, `Information`, `Warning`, `Error`, `Critical`.<br><br>Do not set for .NET test runs as it would cause the tests *themselves* to start emitting logs.|
| `Logging__LogLevel__Azure.Sdk.Tools.TestProxy`| Set to `Debug` to see request level logs emitted by the Test Proxy.|

Both of the above variables can be set in the `docker` runtime by providing additional arguments EG: `docker run -e Logging__LogLevel__Default=Warning azsdkengsys.azurecr.io/engsys/test-proxy:latest`. For multiple environment variables, just use multiple `-e` provisions.

Expand Down

0 comments on commit 173c94c

Please sign in to comment.