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
By default serilog-ui allows access to the log page only for local requests. In order to give appropriate rights for production use, you need to configure authorization. You can secure the log page by allowing specific users or roles to view logs:
69
64
@@ -78,30 +73,39 @@ public void ConfigureServices(IServiceCollection services)
Only `User1` and `User2` oruserswith `AdminRole` rolecanviewlogs. Ifyouset `AuthenticationType` to `Jwt`, youcansetajwttokenandan `Authorization` headerwillbeaddedtotherequestandfor `Cookie` justloginintoyouwebsiteandnoextrastepisrequired.
79
+
Only `User1` and `User2` or users with `AdminRole` role can view logs.
80
+
81
+
If you set `AuthenticationType` to `Jwt`, you can set a jwt token and an `Authorization` header will be added to the request and for `Cookie` just login into you website and no extra step is required.
86
82
87
-
Todisableaccessforlocalrequests, (e.g. fortestingauthenticationlocally) set `AlwaysAllowLocalRequests` to `false`.
83
+
To disable anonymous access for local requests, (e.g. for testing authentication locally) set `AlwaysAllowLocalRequests` to `false`.
84
+
85
+
To disable authorization on production, set `Enabled` to false.
88
86
89
87
```csharp
90
88
services.AddSerilogUi(options=>options
91
89
.EnableAuthorization(authOption=>
92
90
{
93
-
authOption.AlwaysAllowLocalRequests=false;
91
+
authOption.AlwaysAllowLocalRequests=false; // disable anonymous access on local
92
+
authOption.Enabled=false; // disable authorization access check on production
Options can be found in the [UIOptions](src/Serilog.Ui.Web/Extensions/UiOptions.cs) class.
103
99
`internal` properties can generally be set via extension methods, see [SerilogUiOptionBuilderExtensions](src/Serilog.Ui.Web/Extensions/SerilogUiOptionBuilderExtensions.cs)
104
100
101
+
### Log page URL
102
+
103
+
The default url to view the log page is `http://<your-app>/serilog-ui`. If you want to change this url path, just configure the route prefix:
JS code can be ran when loading the file by wrapping the code in a function, and directly running that function like so:
@@ -147,7 +156,7 @@ JS code can be ran when loading the file by wrapping the code in a function, and
147
156
})();
148
157
```
149
158
150
-
## serilog-ui UI frontend development
159
+
## UI: Frontend development
151
160
152
161
The serilog-ui frontend is located inside the Serilog.Ui.Web package.
153
162
@@ -203,9 +212,12 @@ There are two Grunt tasks you can use to build the frontend project:
203
212
- you should be able to run the dev environment on both localhost and 127.0.0.1 (to check if it's working fine, open the console: you'll find a red message: **"[MSW] Mocking enabled."**)
204
213
</details>
205
214
206
-
## Test
215
+
# Known Limitations
216
+
* Additional columns are not supported and only main columns can be retrieved.
217
+
218
+
# Test
207
219
208
-
### .NET Serilog.UI Projects
220
+
## .NET Serilog.UI Projects
209
221
210
222
The test projects are located inside the */tests* folder.
211
223
@@ -220,7 +232,7 @@ To run the tests, use Test Explorer in Visual Studio or run from the root folder
220
232
dotnet test
221
233
```
222
234
223
-
### JS UI assets
235
+
## JS UI assets
224
236
225
237
Tests are located inside src/Serilog.Ui.Web/assets/__tests__
0 commit comments