Skip to content

Trace HTTP requests/errors - #545

Merged
carolynvs merged 2 commits into
openstacknetsdk:masterfrom
carolynvs:533-log-http-requests
Jul 30, 2015
Merged

Trace HTTP requests/errors #545
carolynvs merged 2 commits into
openstacknetsdk:masterfrom
carolynvs:533-log-http-requests

Conversation

@carolynvs

Copy link
Copy Markdown
Member

All HTTP requests and responses (initiated by Flurl, so new stuff only), are traced using the "Flurl.Http" source.

The default level is "Error". To enable tracing add the following to the app.config

  <system.diagnostics>
    <switches>
      <add name="Flurl.Http" value="Information" />
    </switches>
  </system.diagnostics>

or programmatically enable tracing via:

OpenStackNet.Tracing.Http.Listeners.Add(myListener);
OpenStackNet.Tracing.Http.Switch.Level = SourceLevels.All;

Fixes #533

The default level is "Error". To enable tracing add the
following to the app.config

```xml
  <system.diagnostics>
    <switches>
      <add name="Flurl.Http" value="Information" />
    </switches>
  </system.diagnostics>
```

or programmatically enable tracing via:

```csharp
OpenStackNet.Tracing.Http.Listeners.Add(myListener);
OpenStackNet.Tracing.Http.Switch.Level = SourceLevels.All;
```

Fixes openstacknetsdk#533
@carolynvs

Copy link
Copy Markdown
Member Author

@DonSchenck Take a look and let me know what you think. Before I release v1.5.0 I want to add some doc around this explaining how to hook into native .NET tracing with 1-2 common libraries such as nlog or log4net and how to just dump it all to the console too.

@carolynvs carolynvs added this to the v1.5.0 milestone Jul 30, 2015
@carolynvs carolynvs self-assigned this Jul 30, 2015
@DonSchenck

Copy link
Copy Markdown
Contributor

YES!! There have been debugging/helping customers issues in the past where enabling .NET tracing was critical. Thanks for this.

@carolynvs

Copy link
Copy Markdown
Member Author

@DonSchenck What I'd really like to see is a cut/paste config change we can give someone when they run into trouble, have them run their code and then send us the generated file. So that we have a well established way of collecting the trace information.

@DonSchenck

Copy link
Copy Markdown
Contributor

Agreed. I've long wanted some sort of tracing or diagnostic tool that we can deploy.

carolynvs added a commit that referenced this pull request Jul 30, 2015
@carolynvs
carolynvs merged commit 5bcfc56 into openstacknetsdk:master Jul 30, 2015
@carolynvs
carolynvs deleted the 533-log-http-requests branch August 5, 2015 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants