You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-39Lines changed: 73 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,6 @@ To send an exception to Trakerr, it's as simple as calling .SendToTrakerr() on t
40
40
```csharp
41
41
usingIO.TrakerrClient;
42
42
usingSystem;
43
-
usingSystem.Collections.Generic;
44
-
usingSystem.Linq;
45
-
usingSystem.Text;
46
-
usingSystem.Threading.Tasks;
47
43
48
44
namespaceTrakerrSampleApp
49
45
{
@@ -68,14 +64,13 @@ namespace TrakerrSampleApp
68
64
}
69
65
```
70
66
71
-
### Option-2: Send an exception with custom properties to Trakerr
67
+
### Option-2: Send an exception using the TrakerrClient
68
+
The benifit of using the TrakerrClient to automatically create and send your error, as opposed to above, is that you can change the log level. You will, however, have to also add an import.
varappevent=tc.CreateAppEvent(e, AppEvent.LogLevelEnum.Fatal);//Can also change the classification.
125
+
//EventType and EventMessage are set automatically by create app event; you can set them manually from the appevent instance too.
126
+
appevent.EventUser="john@trakerr.io";
127
+
appevent.EventSession="8";
102
128
129
+
appevent.CustomProperties=newCustomData();
130
+
appevent.CustomProperties.StringData=newCustomStringData("This is string data 1!");//Add up to 10 custom strings.
131
+
appevent.CustomProperties.StringData.CustomData2="This is string data 2!";//You can also add strings later like this.
132
+
133
+
tc.SendEventAsync(appevent);
134
+
}
103
135
}
104
136
}
105
137
}
@@ -108,13 +140,12 @@ namespace TrakerrSampleApp
108
140
109
141
110
142
### Option-3: Send any event (including non-exceptions) programmatically
143
+
You can send non-errors to Trakerr. This will send an event without a stacktrace. Be sure to construct the object properly as the default values in `CreateAppEvent` may not be useful for your non-error.
Nearly all of these have default values when passed in `null`. Below is a list of the arguments, and what Trakerr expects so you can pass in custom data.
**apiKey** | **str** | API Key for your application. | Defaults to reading "trakerr.apiKey" property under appSettings from the App.config.
155
-
**url** | **str** | URL to Trakerr. | Defaults to reading "trakerr.url" property under appSettings from the App.config.
156
-
**contextAppVersion** | **str** | Provide the application version. | Defaults to reading "trakerr.contextAppVersion" property under appSettings from the App.config.
157
-
**contextEnvName** | **str** | Provide the environemnt name (development/staging/production). You can also pass in a custom name. | Defaults to reading "trakerr.contextEnvName" property under appSettings from the App.config.
158
-
**contextEnvVersion** | **str** | (Optional) Provide an optional context environment version. | Defaults to `null`.
159
-
**contextEnvHostname** | **str** | Provide the current hostname. | Defaults to the current DNS name if available or uses the Machine name as a fallback.
160
-
**contextAppOS** | **str** | Provide an operating system name. | Defaults to Environment.OSVersion.Platform along with the service pack (eg. Win32NT Service Pack 1).
161
-
**contextAppOSVersion** | **str** | Provide an operating system version. | Defaults to Environment.OSVersion.Version.ToString() (eg. 6.1.7601.65536).
162
-
**contextDataCenter** | **str** | (optional) Provide a datacenter name. | Defaults to `null`.
163
-
**contextDataCenterRegion** | **str** | (optional) Provide a datacenter region. | Defaults to `null`.
**apiKey** | **string** | API Key for your application. | Defaults to reading "trakerr.apiKey" property under appSettings from the App.config.
186
+
**contextAppVersion** | **string** | Provide the application version. | Defaults to reading "trakerr.contextAppVersion" property under appSettings from the App.config.
187
+
**contextDevelopmentStage** | **string** | One of development, staging, production; or a custom string. | Default Value: trakerr.deploymentStage or "development" if not provided.
188
+
**contextEnvLanguage** | **string** | Constant string representing the language the application is in. | Default value: "ruby"
189
+
**contextEnvName** | **string** | Name of the CLR the program is running on | Defaults to returning "Microsoft CLR" if using .Net framework or "Mono" if mono.
190
+
**contextEnvVersion** | **string** | Provide an environment version. | Defaults to reading to the CLR version of .net, or uses reflection to find the mono version.
191
+
**contextEnvHostname** | **string** | Provide the current hostname. | Defaults to the current DNS name if available or uses the Machine name as a fallback.
192
+
**contextAppOS** | **string** | Provide an operating system name. | Defaults to Environment.OSVersion.Platform along with the service pack (eg. Win32NT Service Pack 1).
193
+
**contextAppOSVersion** | **string** | Provide an operating system version. | Defaults to Environment.OSVersion.Version.ToString() (eg. 6.1.7601.65536).
194
+
**contextAppOSBrowser** | **string** | An optional string browser name the application is running on. | Defaults to `null`
195
+
**contextAppOSBrowserVersion** | **string** | An optional string browser version the application is running on. | Defaults to `null`
196
+
**contextDataCenter** | **string** | Data center the application is running on or connected to. | Defaults to `null`
197
+
**contextDataCenterRegion** | **string** | Data center region. | Defaults to `null`
164
198
165
199
If you want to use a default value in a custom call, simply pass in `null` to the argument, and it will be filled with the default value.
0 commit comments