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: README.md
+32-31Lines changed: 32 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,21 @@
1
1
# Bleess.Extensions.Logging.File
2
2
High performance rolling file logger for Microsoft.Extensions.Logging with no other 3rd party dependencies. Modeled after the standard console logger.
3
3
4
-
- Rolling files, max file size, max number or files, rolling by time period
4
+
- Rolling files, max file size, max number of files, rolling by time period
5
5
- Text or Json output as well as custom formatters
6
-
- Standard idomatic configuration (similar to other MS logging providers) using IConfiguration or configuration callbacks
6
+
- Standard idiomatic configuration (similar to other MS logging providers) using IConfiguration or configuration callbacks
7
7
- Abitity to update settings such as log level, filter rules, or log file path while application is running
8
8
- Logging scopes and activity tracking support
9
-
- High performance using dedicated write thread and
9
+
- High performance using dedicated write thread
10
10
- Ability to specify multiple log files with independent settings
11
11
12
-
13
-
This project is very similar to nReco/logging with a few additions: multiple files, logging scopes, json output, streamlined configuration, and abiltity to modify settings while running.
14
-
15
12
## Usage
16
13
17
14
Add the nuget package Bleess.Extensions.Logging.File
18
15
19
-
The log provider is configured just like any other Microsoft.Extensions.Logging providers. There are extensions methods on the ILogBuilder to add the provider.
20
-
21
-
When using Host.CreateDefaultBuilder you only need to call `AddFile()`, and the logger will be configured using configuration providers. There are also other overloads to configure the logger using options callbacks etc.
16
+
The log provider is configured just like any other Microsoft.Extensions.Logging providers. There are extensions methods on the ILogBuilder to add the provider.
17
+
18
+
When using Host.CreateDefaultBuilder you only need to call `AddFile()`, and the logger will be configured using configuration providers. There are also other overloads to configure the logger using options callbacks etc.
22
19
23
20
```csharp
24
21
logBuilder.AddFile();
@@ -139,7 +136,6 @@ Example configuration
139
136
},
140
137
```
141
138
142
-
143
139
## Rolling Behavior
144
140
Log files can have a max file size at which time a new file will be create with a incremented id appended. You may also specify a maximum number of files to retain. Once the maximum number of files has been reached, the oldest will be overwritten.
145
141
Using RollInterval setting, you can also specify that a date will be appended to the file name and the files will roll according to the date in 'yyyyMMddHH' format.
@@ -159,16 +155,19 @@ BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3007/23H2/2023Update/SunValley3
159
155
AMD Ryzen 5 5600H with Radeon Graphics, 1 CPU, 12 logical and 6 physical cores
- Most of the code was a adapted from dotnet source code (specifically Microsoft.Extensions.Logging.Console) https://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Extensions.Logging.Console
211
-
- The FileWriter was adapted from https://github.com/nreco/logging
211
+
- Some of the code was a adapted from dotnet source code (specifically Microsoft.Extensions.Logging.Console) https://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Extensions.Logging.Console
212
+
- The FileWriter was originally adapted from https://github.com/nreco/logging, but has since been significantly modified.
0 commit comments