Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #83 from petemounce/pluggable_logging
Browse files Browse the repository at this point in the history
Replace log4net dependency with LibLog
  • Loading branch information
bvillanueva-mdsol authored Jul 8, 2016
2 parents f24bfe5 + 4dc576d commit bda17ec
Show file tree
Hide file tree
Showing 16 changed files with 2,062 additions and 77 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,17 @@ public class Startup
### Client trace (Outbound request)
Client Trace relies on HttpMessageHandler for HttpClient. Please pass a ZipkinMessageHandler instance into HttpClient.

Note: You will need the `GetOwinContext` extension method. If you host in IIS with `System.Web`, this can be found in `Microsoft.Owin.Host.SystemWeb`.

```
using Medidata.ZipkinTracer.Core.Handlers;
public class HomeController : AsyncController
{
private ILog logger = LogManager.GetLogger("HomeController");
public async Task<ActionResult> Index()
{
var context = System.Web.HttpContext.Current.GetOwinContext();
var client = new ZipkinClient(logger, context);
var client = new ZipkinClient(context);
using (var httpClient = new HttpClient(new ZipkinMessageHandler(client))))
{
Expand Down Expand Up @@ -138,6 +137,12 @@ case the caller member name (method, property etc.) will get recorded.
With the `RecordLocalComponent()` method of the client a local component (or information) can be recorded for the
current trace. This will result an additional binary annotation with the 'lc' key (LOCAL_COMPONENT) and a custom value.

#### Troubleshooting

##### Logs

Logging internal to the library is provided via the [LibLog abstraction](https://github.com/damianh/LibLog). Caveat: to get logs, you must have initialised your logging framework on application-start ([console app example](https://github.com/damianh/LibLog/blob/master/src/LibLog.Example.Log4Net/Program.cs#L12) - a web-app might do this in OWIN Startup or Global.asax, or the inversion of control container initialisation).

## Contributors
ZipkinTracer is (c) Medidata Solutions Worldwide and owned by its major contributors:
* Tomoko Kwan
Expand Down
Loading

0 comments on commit bda17ec

Please sign in to comment.