Skip to content

Commit 6988bac

Browse files
roei sabagroei sabag
authored andcommitted
resolve #2
1 parent 5ecf959 commit 6988bac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class HttpLogger : Logger
2323
private readonly string applicationName;
2424
private static readonly HttpClient client = new HttpClient();
2525

26-
// Will be used to pass values into base class.
26+
// Will be used to pass values into next constructor.
2727
public HttpLogger(string applicationName, string loggerName)
2828
: this(applicationName, loggerName, baseAddress: "http://localhost:5000/")
2929
{ }
@@ -47,13 +47,13 @@ public class HttpLogger : Logger
4747
// At this point the logMessage is already populated and you can change it before sending.
4848
public override void OnExecutor(string level, IDictionary<string, object> logMessage)
4949
{
50-
// setup
51-
var requestBody = JsonConvert.SerializeObject(logMessage);
52-
var content = new StringContent(content: requestBody, Encoding.UTF8, mediaType: "application/json");
53-
5450
// some message manipulation
5551
logMessage["EndPoint"] = $"{baseAddress}/logging";
5652
logMessage["LogType"] = nameof(HttpLogger);
53+
54+
// setup
55+
var requestBody = JsonConvert.SerializeObject(logMessage);
56+
var content = new StringContent(content: requestBody, Encoding.UTF8, mediaType: "application/json");
5757

5858
// send
5959
client.PostAsync("/loggingServe", content).GetAwaiter().GetResult();

0 commit comments

Comments
 (0)