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: 16/umbraco-cms/fundamentals/backoffice/logviewer.md
+83-55Lines changed: 83 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,13 @@ Here are some example queries to help you get started. For more details on the s
30
30
31
31
If you frequently use a custom query, you can save it for quick access. Type your query in the search box and click the heart icon to save it with a friendly name. Saved queries are stored in the `umbracoLogViewerQuery` table in the database.
32
32
33
-
## Implementing Your Own Log Viewer
33
+
## Implementing Your Own Log Viewer Source
34
34
35
-
Umbraco allows you to implement a customn `ILogViewer` to fetch logs from alternative sources, such as **Azure Table Storage**.
35
+
Umbraco allows you to implement a customn `ILogViewerRepository` to fetch logs from alternative sources, such as **Azure Table Storage**.
36
36
37
-
### Creating a Custom Log Viewer
37
+
### Creating a Custom Log Viewer Repository
38
38
39
-
To fetch logs from Azure Table Storage, implement the `SerilogLogViewerSourceBase` class from `Umbraco.Cms.Core.Logging.Viewer`.
39
+
To fetch logs from Azure Table Storage, extend the `LogViewerRepositoryBase` class from `Umbraco.Cms.Infrastructure.Services.Implement`.
40
40
41
41
{% hint style="info" %}
42
42
This implementation requires the `Azure.Data.Tables` NuGet package.
//Replace ACCOUNT_NAME and KEY with your actual Azure Storage Account details. The "Logs" parameter refers to the table name where logs will be stored and retrieved from.
71
+
// This example uses a connetionstring compatible with the Azurite emulator
// Table storage does not support skip, only take, so the best we can do is to not fetch more entities than we need in total.
77
-
// See: https://learn.microsoft.com/en-us/rest/api/storageservices/writing-linq-queries-against-the-table-service#returning-the-top-n-entities for more info.
Azure Table Storage requires entities to implement the `ITableEntity` interface. Since Umbraco’s default log entity does not implement this, a custom entity (`AzureTableLogEntity`) must be created to ensure logs are correctly fetched and stored.
146
+
Azure Table Storage requires entities to implement the `ITableEntity` interface. Since Umbraco’s default log entity does not implement this, a custom entity (`AzureTableLogEntity`) must be created to ensure logs are correctly fetched.
120
147
121
148
### Register implementation
122
149
123
-
Umbraco needs to be made aware that there is a new implementation of an `ILogViewer` to register. We also need to replace the default JSON LogViewer that we ship in the core of Umbraco.
150
+
Umbraco needs to be made aware that there is a new implementation of an `ILogViewerRepository` to register. We also need to replace the default JSON LogViewer that is shipped in the core of Umbraco.
Copy file name to clipboardExpand all lines: 16/umbraco-cms/fundamentals/code/debugging/logging.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,10 @@ Serilog uses levels as the primary means for assigning importance to log events.
117
117
118
118
Serilog can be configured and extended by using the .NET Core configuration such as the AppSetting.json files or environment variables. For more information, see the [Serilog config](../../../reference/configuration/serilog.md) article.
119
119
120
+
## The UmbracoFile Sink
121
+
122
+
Serilog uses the concept of Sinks to output the log messages to different places. Umbraco ships with a custom sink configuration called UmbracoFile that uses the [Serilog.Sinks.File](https://github.com/serilog/serilog-sinks-file) sink to save the logs to a rolling file on disk in the Umbraco. You can disable this sink by setting its Enabled configuration flag to false, see [Serilog config](../../../reference/configuration/serilog.md) for more information.
123
+
120
124
## The logviewer dashboard
121
125
122
126
Learn more about the [logviewer dashboard](../../backoffice/logviewer.md) in the backoffice and how it can be extended.
Copy file name to clipboardExpand all lines: 16/umbraco-cms/reference/configuration/serilog.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ By default, Umbraco uses a special Serilog 'sink' that is optimized for performa
105
105
{
106
106
"Name": "UmbracoFile",
107
107
"Args": {
108
+
"Enabled": "True",
108
109
"RestrictedToMinimumLevel": "Warning",
109
110
"FileSizeLimitBytes": 1073741824,
110
111
"RollingInterval" : "Day",
@@ -117,6 +118,8 @@ By default, Umbraco uses a special Serilog 'sink' that is optimized for performa
117
118
}
118
119
```
119
120
121
+
You can also disable this sink if you do not wish to write files to disk.
122
+
120
123
## Adding a custom log property to all log items
121
124
122
125
You may wish to add a log property to all log messages. A good example could be a log property for the `environment` to determine if the log message came from `development` or `production`.
0 commit comments