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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ A Serilog sink that writes log events to the Windows Console or an ANSI terminal
6
6
7
7
To use the console sink, first install the [NuGet package](https://nuget.org/packages/serilog.sinks.console):
8
8
9
-
```powershell
10
-
Install-Package Serilog.Sinks.Console
9
+
```shell
10
+
dotnet add package Serilog.Sinks.Console
11
11
```
12
12
13
13
Then enable the sink using `WriteTo.Console()`:
@@ -64,8 +64,8 @@ The default template, shown in the example above, uses built-in properties like
64
64
65
65
The sink can write JSON output instead of plain text. `CompactJsonFormatter` or `RenderedCompactJsonFormatter` from [Serilog.Formatting.Compact](https://github.com/serilog/serilog-formatting-compact) is recommended:
66
66
67
-
```powershell
68
-
Install-Package Serilog.Formatting.Compact
67
+
```shell
68
+
dotnet add package Serilog.Formatting.Compact
69
69
```
70
70
71
71
Pass a formatter to the `Console()` configuration method:
@@ -80,8 +80,8 @@ Output theming is not available when custom formatters are used.
80
80
81
81
To use the console sink with the [Serilog.Settings.AppSettings](https://github.com/serilog/serilog-settings-appsettings) package, first install that package if you haven't already done so:
82
82
83
-
```powershell
84
-
Install-Package Serilog.Settings.AppSettings
83
+
```shell
84
+
dotnet add package Serilog.Settings.AppSettings
85
85
```
86
86
87
87
Instead of configuring the logger in code, call `ReadFrom.AppSettings()`:
@@ -114,8 +114,8 @@ To configure the console sink with a different theme and include the `SourceCont
114
114
115
115
To use the console sink with _Microsoft.Extensions.Configuration_, for example with ASP.NET Core or .NET Core, use the [Serilog.Settings.Configuration](https://github.com/serilog/serilog-settings-configuration) package. First install that package if you have not already done so:
116
116
117
-
```powershell
118
-
Install-Package Serilog.Settings.Configuration
117
+
```shell
118
+
dotnet add package Serilog.Settings.Configuration
119
119
```
120
120
121
121
Instead of configuring the sink directly in code, call `ReadFrom.Configuration()`:
@@ -168,7 +168,7 @@ When contributing please keep in mind our [Code of Conduct](CODE_OF_CONDUCT.md).
168
168
Branch | AppVeyor | Travis
169
169
------------- | ------------- |-------------
170
170
dev | [](https://ci.appveyor.com/project/serilog/serilog-sinks-console/branch/dev) | [](https://travis-ci.org/serilog/serilog-sinks-console)
0 commit comments