Skip to content

Commit 6fc6e30

Browse files
committed
Added Logging section to clustered environment document
1 parent 7c6df18 commit 6fc6e30

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

docs/en/Clustered-Environment.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Once multiple instances of your application run in parallel, you should carefull
4242

4343
ASP.NET Core provides different kind of caching features. [In-memory cache](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/memory) stores your objects in the memory of the local server and is only available to the application that stored the object. Non-sticky sessions in a clustered environment should use the [distributed caching](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed) except some specific scenarios (for example, you can cache a local CSS file into memory. It is read-only data and it is the same in all application instances. You can cache it in memory for performance reasons without any problem).
4444

45-
[ASPNET Boilerplate caching system](https://aspnetboilerplate.com/Pages/Documents/Caching) extends [ASP.NET Core's in-memory cache](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-6.0) infrastructure. It works in-memory by default. You should configure an actual distributed cache provider when you want to deploy your application to a clustered environment. ASPNET Boilerplate provides built-in Redis implementation. It is already implemented in ASPNET Zero. You should go to the `[YOURAPPNAME]WebCoreModule` and uncomment following code.
45+
[ASPNET Boilerplate caching system](https://aspnetboilerplate.com/Pages/Documents/Caching) extends [ASP.NET Core's in-memory cache](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-6.0) infrastructure. It works in-memory by default. You should configure an actual distributed cache provider when you want to deploy your application to a clustered environment. ASPNET Boilerplate provides built-in Redis implementation. It is already implemented in ASP.NET Zero. You should go to the `[YOURAPPNAME]WebCoreModule` and uncomment following code.
4646

4747
_[YOURAPPNAME]WebCoreModule.cs_
4848
```csharp
@@ -59,7 +59,7 @@ For more information check [caching](https://aspnetboilerplate.com/Pages/Documen
5959

6060
ASPNET Boilerplate's [background job system](https://aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers) is used to queue tasks to be executed in the background. Background job queue is persistent and a queued task is guaranteed to be executed (it is re-tried if it fails).
6161

62-
If you want to run background jobs in multiple instances ASPNET Boilerplates provides you Hangfire implementation. You can replace background job system with Hangfire. It is already implemented in ASPNET Zero. To enable Hangfire, go to the `WebConsts.cs` and set `HangfireDashboardEnabled` true.
62+
If you want to run background jobs in multiple instances ASPNET Boilerplates provides you Hangfire implementation. You can replace background job system with Hangfire. It is already implemented in ASP.NET Zero. To enable Hangfire, go to the `WebConsts.cs` and set `HangfireDashboardEnabled` true.
6363

6464
_WebConsts.cs_
6565
```csharp
@@ -94,4 +94,11 @@ For more information check [background jobs and workers](https://aspnetboilerpla
9494

9595
## Scaling SignalR
9696

97-
ASPNET Zero has a built-in chat system and real-time notification system. They both use [signalR](https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction). Before using multiple instances of your project, you should check [signalR's scaling documentation](https://docs.microsoft.com/en-us/aspnet/core/signalr/scale) and choose SignalR backplane providers or AzureSignalR.
97+
ASP.NET Zero has a built-in chat system and real-time notification system. They both use [signalR](https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction). Before using multiple instances of your project, you should check [signalR's scaling documentation](https://docs.microsoft.com/en-us/aspnet/core/signalr/scale) and choose SignalR backplane providers or AzureSignalR.
98+
99+
## Logging
100+
101+
ASP.NET Zero uses [log4net](https://github.com/apache/logging-log4net) for logging. If you host your application with multiple instances, each instance will write logs to its specified log file and directory by default.
102+
103+
For clustered environments, if you want to use a centralized logging as well, you can use a centralized logging approach. As an example, you can configure log4net to write logs to Elasticsearch (via [https://www.nuget.org/packages/Elastic.CommonSchema.Log4net](https://www.nuget.org/packages/Elastic.CommonSchema.Log4net)). Then, you can view logs from Elasticsearch UI. In this case, AspNet Zero's log display tab in Maintenance UI will be useless, you can disable it.
104+

0 commit comments

Comments
 (0)