Skip to content

Commit

Permalink
feat: info about serilog context properties (#5964)
Browse files Browse the repository at this point in the history
* feat: info about serilog context properties

* Update serilog.md

* Fix markdown linter warnings

Co-authored-by: Aaron Stannard <aaron@petabridge.com>
Co-authored-by: Gregorius Soedharmo <arkatufus@yahoo.com>
  • Loading branch information
3 people committed May 26, 2022
1 parent a4a6fdd commit ce1b8ef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/articles/utilities/serilog.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ var logger = new LoggerConfiguration()
.CreateLogger();
```

## Formatting OutputTemplate

There are few properties that one can use in their `OutputTemplate` for logger configuration:

* `ActorPath` - contains the current actor's path.
* `LogSource` - also contains `ActorPath`, however it can also have other values such as:
* `<TypeName> (<ActorSystemName>)`
* `<string> (<ActorSystemName>)`
* `Thread` - thread id on which given log action was executed.

### Example OutputTemplate

```console
[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] [{ActorPath}] [{SourceContext}] {Message}{NewLine}{Exception}
```

## HOCON Configuration

In order to be able to change log level without the need to recompile, we need to employ some sort of application configuration. To use Serilog via HOCON configuration, add the following to the __App.config__ of the project.
Expand Down

0 comments on commit ce1b8ef

Please sign in to comment.