Skip to content

Instantly share code, notes, and snippets.

@avvero
Created February 22, 2018 03:16
Show Gist options
  • Select an option

  • Save avvero/fbd0bb3375a80423d94ab241168b7e7b to your computer and use it in GitHub Desktop.

Select an option

Save avvero/fbd0bb3375a80423d94ab241168b7e7b to your computer and use it in GitHub Desktop.
put serverId to the #log
def serverId = Math.abs(new Random().nextInt() % 89) + 10
appender("file", RollingFileAppender) {
file = "main.log"
encoder(PatternLayoutEncoder) {
charset = java.nio.charset.StandardCharsets.UTF_8
pattern = "\\(serverId=${serverId}\\) %d{yyyy-MM-dd HH:mm:ss.SSS}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment