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: 14/umbraco-cms/fundamentals/backoffice/logviewer.md
+37-38Lines changed: 37 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,45 +4,45 @@ description: Information on using the Umbraco log viewer
4
4
5
5
# Log Viewer
6
6
7
-
Umbraco ships with a built-in Log Viewer feature. This allows you to filter and view log entries and perform much more complex search queries. This helps you find the log entries that you are interested in. You can find the Log viewer in the Settings section.
7
+
Umbraco ships with a built-in Log Viewer feature. This allows you to filter, view log entries, perform complex search queries, and analyze logs for debugging. You can find the Log viewer in the **Settings** section of the Umbraco backoffice.
Learn how to use the Log Viewer to read and understand logs for your Umbraco CMS website.
11
11
{% endembed %}
12
12
13
13
## Benefits
14
14
15
-
Have you ever wanted to find all log entries which contain the same request ID? Or find all items in the log where a property called duration is greater than 1000ms?
15
+
Ever needed to find all log entries containing the same request ID? Or locate all logs where a property called `Duration` exceeds 1000ms?
16
16
17
-
With the power of structured logging and a query language, we are able to search and find log items for specific scenarios. When debugging the site you should now have more power to see and find patterns in your log files and get rid of those errors.
17
+
With structured logging and a query language, you can efficiently search and identify log items for specific scenarios. This helps in debugging and finding patterns in your logs, making it easier to resolve issues.
18
18
19
-
## Example queries
19
+
## Example Queries
20
20
21
-
Here are a handful of example queries to get you started, however, the saved searches contain some further examples. For more details on the syntax head over to the https://github.com/serilog/serilog-filters-expressions project.
21
+
Here are some example queries to help you get started. For more details on the syntax, see the https://github.com/serilog/serilog-filters-expressions project.
22
22
23
-
**Find all logs that are from the namespace 'Umbraco.Core'**\
24
-
`StartsWith(SourceContext, 'Umbraco.Core')`\\
23
+
**Find all logs that are from the namespace 'Umbraco.Core'**
24
+
`StartsWith(SourceContext, 'Umbraco.Core')`
25
25
26
-
**Find all logs that have the property 'Duration' and the duration is greater than 1000ms**\
27
-
`Has(Duration) and Duration > 1000`\\
26
+
**Find all logs that have the property 'Duration' and the duration is greater than 1000ms**
27
+
`Has(Duration) and Duration > 1000`
28
28
29
-
**Find all logs where the message has localhost in it with SQL like**\
30
-
`@Message like '%localhost%'`\\
29
+
**Find all logs where the message has localhost in it with SQL like**
30
+
`@Message like '%localhost%'`
31
31
32
32
## Saved Searches
33
33
34
-
Sometimes you want to use a custom query more often. It is possible to save a query and use the dropdown to re-use your saved search. To add a new saved search, use the search box to type your query and click the star icon. In doing so you can give it a friendly name. The saved queries are saved in the database in the table `umbracoLogViewerQuery`.
34
+
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.
35
35
36
-
## Implementing your own Log Viewer
36
+
## Implementing Your Own Log Viewer
37
37
38
-
With the flexibility of Umbraco, we give you the power to implement your own`ILogViewer`. This makes it possible to fetch logs and the saved searches from a different location such as Azure table storage.
38
+
Umbraco allows you to implement a customn`ILogViewer`to fetch logs from alternative sources, such as **Azure Table Storage**.
39
39
40
-
### Create your own implementation
40
+
### Creating a Custom Log Viewer
41
41
42
-
To do this we can implement a base class`SerilogLogViewerSourceBase` from `Umbraco.Cms.Core.Logging.Viewer` like so.
42
+
To fetch logs from Azure Table Storage, implement the`SerilogLogViewerSourceBase`class from `Umbraco.Cms.Core.Logging.Viewer`.
43
43
44
44
{% hint style="info" %}
45
-
This uses the `Azure.Data.Tables` NuGet package.
45
+
This implementation requires the `Azure.Data.Tables` NuGet package.
46
46
{% endhint %}
47
47
48
48
```csharp
@@ -70,6 +70,7 @@ public class AzureTableLogViewer : SerilogLogViewerSourceBase
//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.
//Optional: If you want to store saved searches in the Azure Table Storage, implement here a method to remove from the Azure Table.
109
+
//This method is optional. If you store saved searches in Azure Table Storage, implement deleting logic here.
109
110
returnbase.DeleteSavedSearch(name, query);
110
111
}
111
112
}
@@ -118,7 +119,7 @@ public class AzureTableLogEntity : LogEventEntity, ITableEntity
118
119
}
119
120
```
120
121
121
-
Keep in mind that we have to implement our own version of a `LogEventEntity`. This is because the `TableClient` needs whatever it is fetching to implement the `ITableEntity` interface.
122
+
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.
122
123
123
124
### Register implementation
124
125
@@ -136,14 +137,14 @@ public class LogViewerSavedSearches : IComposer
136
137
}
137
138
```
138
139
139
-
### Configure Umbraco to log into Azure Table Storage
140
+
### Configuring Logging to Azure Table Storage
140
141
141
-
Now with the above two classes, we have the plumbing in place to view logs from an Azure Table. However, we are not persisting our logs into the Azure table storage account. So we need to configure the Serilog logging pipeline to store our logs in Azure table storage.
142
+
With the above two classes, the setup is in place to view logs from an Azure Table. However, logs are not yet persisted into the Azure Table Storage account. To enable persistence, configure the Serilog logging pipeline to store logs in Azure Table Storage.
142
143
143
-
* Install Serilog.Sinks.AzureTableStorage from Nuget
144
-
* Add a new sink to the appsettings with credentials (so logs persist to Azure)
144
+
* Install `Serilog.Sinks.AzureTableStorage` from NuGet.
145
+
* Add a new sink to `appsettings.json` with credentials to persist logs to Azure.
145
146
146
-
The following sink needs to be added to the array [`Serilog:WriteTo`](https://github.com/serilog/serilog-sinks-azuretablestorage#json-configuration).
147
+
The following sink needs to be added to the [`Serilog:WriteTo`](https://github.com/serilog/serilog-sinks-azuretablestorage#json-configuration) array.
147
148
148
149
```json
149
150
{
@@ -155,10 +156,8 @@ The following sink needs to be added to the array [`Serilog:WriteTo`](https://gi
155
156
}
156
157
```
157
158
158
-
For more in-depth information about logging and how to configure it, please read the [logging documentation](../code/debugging/logging.md).
159
+
For more in-depth information about logging and how to configure it, see the [Logging](../code/debugging/logging.md) article.
159
160
160
161
### Compact Log Viewer - Desktop App
161
162
162
-
This is a desktop tool for viewing & querying JSON log files from disk in the same way as the built-in logviewer dashboard of Umbraco.
[Compact Log Viewer](https://www.microsoft.com/store/apps/9N8RV8LKTXRJ?cid=storebadge\&ocid=badge). A desktop tool is available for viewing and querying JSON log files in the same way as the built-in Log Viewer in Umbraco.
Copy file name to clipboardExpand all lines: 15/umbraco-cms/fundamentals/backoffice/logviewer.md
+37-38Lines changed: 37 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,45 +4,45 @@ description: Information on using the Umbraco log viewer
4
4
5
5
# Log Viewer
6
6
7
-
Umbraco ships with a built-in Log Viewer feature. This allows you to filter and view log entries and perform much more complex search queries. This helps you find the log entries that you are interested in. You can find the Log viewer in the Settings section.
7
+
Umbraco ships with a built-in Log Viewer feature. This allows you to filter, view log entries, perform complex search queries, and analyze logs for debugging. You can find the Log viewer in the **Settings** section of the Umbraco backoffice.
Learn how to use the Log Viewer to read and understand logs for your Umbraco CMS website.
11
11
{% endembed %}
12
12
13
13
## Benefits
14
14
15
-
Have you ever wanted to find all log entries which contain the same request ID? Or find all items in the log where a property called duration is greater than 1000ms?
15
+
Ever needed to find all log entries containing the same request ID? Or locate all logs where a property called `Duration` exceeds 1000ms?
16
16
17
-
With the power of structured logging and a query language, we are able to search and find log items for specific scenarios. When debugging the site you should now have more power to see and find patterns in your log files and get rid of those errors.
17
+
With structured logging and a query language, you can efficiently search and identify log items for specific scenarios. This helps in debugging and finding patterns in your logs, making it easier to resolve issues.
18
18
19
-
## Example queries
19
+
## Example Queries
20
20
21
-
Here are a handful of example queries to get you started, however, the saved searches contain some further examples. For more details on the syntax head over to the https://github.com/serilog/serilog-filters-expressions project.
21
+
Here are some example queries to help you get started. For more details on the syntax, see the https://github.com/serilog/serilog-filters-expressions project.
22
22
23
-
**Find all logs that are from the namespace 'Umbraco.Core'**\
24
-
`StartsWith(SourceContext, 'Umbraco.Core')`\\
23
+
**Find all logs that are from the namespace 'Umbraco.Core'**
24
+
`StartsWith(SourceContext, 'Umbraco.Core')`
25
25
26
-
**Find all logs that have the property 'Duration' and the duration is greater than 1000ms**\
27
-
`Has(Duration) and Duration > 1000`\\
26
+
**Find all logs that have the property 'Duration' and the duration is greater than 1000ms**
27
+
`Has(Duration) and Duration > 1000`
28
28
29
-
**Find all logs where the message has localhost in it with SQL like**\
30
-
`@Message like '%localhost%'`\\
29
+
**Find all logs where the message has localhost in it with SQL like**
30
+
`@Message like '%localhost%'`
31
31
32
32
## Saved Searches
33
33
34
-
Sometimes you want to use a custom query more often. It is possible to save a query and use the dropdown to re-use your saved search. To add a new saved search, use the search box to type your query and click the star icon. In doing so you can give it a friendly name. The saved queries are saved in the database in the table `umbracoLogViewerQuery`.
34
+
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.
35
35
36
-
## Implementing your own Log Viewer
36
+
## Implementing Your Own Log Viewer
37
37
38
-
With the flexibility of Umbraco, we give you the power to implement your own`ILogViewer`. This makes it possible to fetch logs and the saved searches from a different location such as Azure table storage.
38
+
Umbraco allows you to implement a customn`ILogViewer`to fetch logs from alternative sources, such as **Azure Table Storage**.
39
39
40
-
### Create your own implementation
40
+
### Creating a Custom Log Viewer
41
41
42
-
To do this we can implement a base class`SerilogLogViewerSourceBase` from `Umbraco.Cms.Core.Logging.Viewer` like so.
42
+
To fetch logs from Azure Table Storage, implement the`SerilogLogViewerSourceBase`class from `Umbraco.Cms.Core.Logging.Viewer`.
43
43
44
44
{% hint style="info" %}
45
-
This uses the `Azure.Data.Tables` NuGet package.
45
+
This implementation requires the `Azure.Data.Tables` NuGet package.
46
46
{% endhint %}
47
47
48
48
```csharp
@@ -70,6 +70,7 @@ public class AzureTableLogViewer : SerilogLogViewerSourceBase
//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.
//Optional: If you want to store saved searches in the Azure Table Storage, implement here a method to remove from the Azure Table.
109
+
//This method is optional. If you store saved searches in Azure Table Storage, implement deleting logic here.
109
110
returnbase.DeleteSavedSearch(name, query);
110
111
}
111
112
}
@@ -118,7 +119,7 @@ public class AzureTableLogEntity : LogEventEntity, ITableEntity
118
119
}
119
120
```
120
121
121
-
Keep in mind that we have to implement our own version of a `LogEventEntity`. This is because the `TableClient` needs whatever it is fetching to implement the `ITableEntity` interface.
122
+
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.
122
123
123
124
### Register implementation
124
125
@@ -136,14 +137,14 @@ public class LogViewerSavedSearches : IComposer
136
137
}
137
138
```
138
139
139
-
### Configure Umbraco to log into Azure Table Storage
140
+
### Configuring Logging to Azure Table Storage
140
141
141
-
Now with the above two classes, we have the plumbing in place to view logs from an Azure Table. However, we are not persisting our logs into the Azure table storage account. So we need to configure the Serilog logging pipeline to store our logs in Azure table storage.
142
+
With the above two classes, the setup is in place to view logs from an Azure Table. However, logs are not yet persisted into the Azure Table Storage account. To enable persistence, configure the Serilog logging pipeline to store logs in Azure Table Storage.
142
143
143
-
* Install Serilog.Sinks.AzureTableStorage from Nuget
144
-
* Add a new sink to the appsettings with credentials (so logs persist to Azure)
144
+
* Install `Serilog.Sinks.AzureTableStorage` from NuGet.
145
+
* Add a new sink to `appsettings.json` with credentials to persist logs to Azure.
145
146
146
-
The following sink needs to be added to the array [`Serilog:WriteTo`](https://github.com/serilog/serilog-sinks-azuretablestorage#json-configuration).
147
+
The following sink needs to be added to the [`Serilog:WriteTo`](https://github.com/serilog/serilog-sinks-azuretablestorage#json-configuration) array.
147
148
148
149
```json
149
150
{
@@ -155,10 +156,8 @@ The following sink needs to be added to the array [`Serilog:WriteTo`](https://gi
155
156
}
156
157
```
157
158
158
-
For more in-depth information about logging and how to configure it, please read the [logging documentation](../code/debugging/logging.md).
159
+
For more in-depth information about logging and how to configure it, see the [Logging](../code/debugging/logging.md) article.
159
160
160
161
### Compact Log Viewer - Desktop App
161
162
162
-
This is a desktop tool for viewing & querying JSON log files from disk in the same way as the built-in logviewer dashboard of Umbraco.
[Compact Log Viewer](https://www.microsoft.com/store/apps/9N8RV8LKTXRJ?cid=storebadge\&ocid=badge). A desktop tool is available for viewing and querying JSON log files in the same way as the built-in Log Viewer in Umbraco.
0 commit comments