https://github.com/logicmonitor/serilog-sinks-logicmonitor
Serilog sync for logicmonitor
https://github.com/logicmonitor/serilog-sinks-logicmonitor
Last synced: about 1 year ago
JSON representation
Serilog sync for logicmonitor
- Host: GitHub
- URL: https://github.com/logicmonitor/serilog-sinks-logicmonitor
- Owner: logicmonitor
- License: mpl-2.0
- Created: 2022-06-13T11:37:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T14:05:48.000Z (almost 3 years ago)
- Last Synced: 2024-03-26T22:47:28.198Z (about 2 years ago)
- Language: C#
- Size: 23.4 KB
- Stars: 3
- Watchers: 7
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serilog.Sinks.LogicMonitor
A Serilog sink that send events and logs staight away to LogicMonitor.
This Package Uses LogicMonitor.DataSDK to send logs.
Export the following environment variable.
System property | Environment variable | Description |
|----------|-------------|:------|
| `Configration.company` | `LM_COMPANY` | Account name (Company Name) is your organization name |
| `Configration.AccessID` | `LM_ACCESS_ID` | Access id while using LMv1 authentication. (Not needed while using Bearer API ) |
| `Configration.AccessKey` | `LM_ACCESS_KEY` | Access key while using LMv1 authentication. (Not needed while using Bearer API ) |
```csharp
using (var log = new LoggerConfiguration()
.WriteTo.LogicMonitor()
.CreateLogger())
{
// An example
log.Information("My Log to LogicMonitor");
}
```
or
```csharp
//Note.: Object of 'LogicMonitor.DataSDK.Configuration' class and not 'Serilog.Configuration'
Configuration configuration = new Configuration(company: "YourCompanyName", accessID: "LM_ACCESS_ID", accessKey: "LM_ACCESS_ID");
using (var log = new LoggerConfiguration()
.WriteTo.LogicMonitor(configuration)
.CreateLogger())
{
// An example
log.Information("My Log to LogicMonitor");
}
```