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

Commit

Permalink
Merge pull request #14 from jhueppauff/add-service-bus-support
Browse files Browse the repository at this point in the history
Add service bus support
  • Loading branch information
jhueppauff authored Jul 1, 2019
2 parents 0c8e47a + 06158ca commit 30f4169
Show file tree
Hide file tree
Showing 12 changed files with 231 additions and 369 deletions.
96 changes: 90 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Syslog.Server

A simple .NET Core multi threaded syslog server, which saves syslog entries to Azure Table Storage
A simple .NET Core multi-threaded Syslog server, which saves Syslog entries to Azure Table Storage, Azure ServiceBus or a Local File.

## PreRequisite

Expand All @@ -19,14 +19,98 @@ A simple .NET Core multi threaded syslog server, which saves syslog entries to A
- Use the Visual Studio Publish function (right click on the project -> publish)

## How to run

There are 3 Options to save the Messages to.
- Azure Storage Account
- Azure Service Bus
- Local FileSystem (JSON File, not intended for production use)
- You can disable output actions by setting the config value "Enabled" to false

### Azure Storage Account

- Create Azure Storage Account. See [Microsoft Docs](https://docs.microsoft.com/en-us/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal)
- Retrieve the Azure Storage Connection String from the Azure Resource
- Add your Azure Storage Connection String to the appsettings.json
- Add your Azure Storage Connection string to the appsettings.json

```json
{
"StorageEndpointConfiguration": [
{
"ConnectionString": "[Your ConnectionString]",
"Enabled": true,
"ConnectionType": "TableStorage",
"Name" : "syslogMessages"
}
]
}
```

### Azure ServiceBus

- Create an Azure ServiceBus See [Microsoft Docs](https://docs.microsoft.com/de-de/azure/service-bus-messaging/service-bus-quickstart-portal)
- Retrieve the Connection String from the Azure ServiceBus (Hidden under "Shared access policy")
- Add your Connection string to the appsettings.json
- Create a Queue in the Service Bus

```json
{
"StorageEndpointConfiguration": [
{
"ConnectionString": "[Your ConnectionString]",
"Enabled": true,
"ConnectionType": "ServiceBus",
"Name" : "[your queue name]"
}
]
}
```

### Local File System

- Create an empty File somewhere in your FileSystem and ensure access
- Add the File Path and File Name to the config

```json
{
"AzureStorage": {
"StorageConnectionString": ""
}
"StorageEndpointConfiguration": [
{
"ConnectionString": "[Path to the File]",
"Enabled": true,
"ConnectionType": "ServiceBus",
"Name" : "[File name]"
}
]
}
```
- dotnet Syslog.Server.dll

### All together

You can configure multiple outputs (even multiple times the same output type, e.g. 2 table storages)
Just add every output you like to the config and choose the correct ```ConnectionType```.

```json
{
"StorageEndpointConfiguration": [
{
"ConnectionString": "",
"Enabled": true,
"ConnectionType": "ServiceBus",
"Name": "syslogMessages"
},
{
"ConnectionString": "",
"Enabled": true,
"ConnectionType": "TableStorage",
"Name" : "syslogMessages"
},
{
"ConnectionString": "",
"Enabled": true,
"ConnectionType": "LocalFile",
"Name" : "log.txt"
}
]
}
```

- Run ```dotnet Syslog.Server.dll``` on the command line
264 changes: 0 additions & 264 deletions Syslog.API/.gitignore

This file was deleted.

Loading

0 comments on commit 30f4169

Please sign in to comment.