Skip to content

Commit

Permalink
Flisespikk på Secure logs using Marker
Browse files Browse the repository at this point in the history
  • Loading branch information
ahusby authored Jul 6, 2023
1 parent c5feea1 commit f8de1d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/observability/logs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The max log message size in Docker is 16KB, so if it will be split into parts if
```

### Secure logs using Marker
How to decide which logging events go to secure logs vs. the ordinary, non-secure app logs? Here is one idea.

Using the Logback config below you can log to secure logs by writing Kotlin-code like this:
```
Expand All @@ -72,7 +73,8 @@ import org.slf4j.MarkerFactory
val log: Logger = ...
val SECURE: Marker= MarkerFactory.getMarker("SECURE_LOG")
...
log.info(SECURE, "Sensitive data here")
log.info(SECURE, "Sensitive data here") // Logging to secure logs
log.info("Non-sensitive data here") // Logging to non-secure app logs
```

logback.xml:
Expand Down

0 comments on commit f8de1d4

Please sign in to comment.