Skip to content

Commit f4ef57d

Browse files
committed
Further updates
1 parent 94c27fa commit f4ef57d

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

16/umbraco-cms/fundamentals/backoffice/logviewer.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you frequently use a custom query, you can save it for quick access. Type you
3232

3333
## Implementing Your Own Log Viewer Source
3434

35-
Umbraco allows you to implement a customn `ILogViewerRepository` to fetch logs from alternative sources, such as **Azure Table Storage**.
35+
Umbraco allows you to implement a custom `ILogViewerRepository` and `ILogViewerService` to fetch logs from alternative sources, such as **Azure Table Storage**.
3636

3737
### Creating a Custom Log Viewer Repository
3838

@@ -152,19 +152,16 @@ The next thing we need to do is create a new service that amongst other things i
152152
```csharp
153153
public class AzureTableLogsService : LogViewerServiceBase
154154
{
155-
private readonly ILogViewerRepository _logViewerRepository;
156-
157155
public AzureTableLogsService(
158156
ILogViewerQueryRepository logViewerQueryRepository,
159157
ICoreScopeProvider provider,
160158
ILogViewerRepository logViewerRepository)
161159
: base(logViewerQueryRepository, provider, logViewerRepository)
162160
{
163-
_logViewerRepository = logViewerRepository;
164161
}
165162

166-
// Change this to what you think is sensible
167-
// as an example we check whether more than 5 days off logs are requested
163+
// Change this to what you think is sensible.
164+
// As an example we check whether more than 5 days off logs are requested.
168165
public override Task<Attempt<bool, LogViewerOperationStatus>> CanViewLogsAsync(LogTimePeriod logTimePeriod)
169166
{
170167
return logTimePeriod.EndTime - logTimePeriod.StartTime < TimeSpan.FromDays(5)
@@ -177,17 +174,17 @@ public class AzureTableLogsService : LogViewerServiceBase
177174
var configuredLogLevels = new Dictionary<string, LogLevel>
178175
{
179176
{ "Global", GetGlobalMinLogLevel() },
180-
{ "AzureTableStorage", _logViewerRepository.RestrictedToMinimumLevel() },
177+
{ "AzureTableStorage", LogViewerRepository.RestrictedToMinimumLevel() },
181178
};
182179

183180
return configuredLogLevels.AsReadOnly();
184181
}
185182
}
186183
```
187184

188-
### Register implementation
185+
### Register implementations
189186

190-
Umbraco needs to be made aware that there is a new implementation of an `ILogViewerRepository` and an `ILogViewerService` to register. These need to replace the default ones that are shipped with Umbraco.
187+
Umbraco needs to be made aware that there is a new implementation of an `ILogViewerRepository` and an `ILogViewerService`. These need to replace the default ones that are shipped with Umbraco.
191188

192189
```csharp
193190
using Umbraco.Cms.Core.Composing;

0 commit comments

Comments
 (0)