Skip to content
Snippets Groups Projects

Prevent log explosion

Merged Jan David Mol requested to merge harden-lggogin into master
1 file
+ 11
8
Compare changes
  • Side-by-side
  • Inline
@@ -112,6 +112,9 @@ healthchecks.require_healthy = true
.timestamp = parse_timestamp(.ts, "%F %T,%3f") ?? .timestamp
.level = downcase!(.level || "info")
# hard limit on message size to prevent explosion
.message = truncate!(.message, limit: 8192, ellipsis: true)
# add nomad info
.nomad.job = .label."com.hashicorp.nomad.job_name" || ""
.nomad.task = .label."com.hashicorp.nomad.task_name" || ""
@@ -130,14 +133,14 @@ healthchecks.require_healthy = true
del(.host)
'''
[sinks.console]
# useful for debugging loki and/or grafana,
# since without them it is harder to see logs
# of for example crashing containers
type = "console"
inputs = [ "nomad-flags" ]
encoding.codec = "logfmt"
buffer.when_full = "drop_newest"
#[sinks.console]
# # useful for debugging loki and/or grafana,
# # since without them it is harder to see logs
# # of for example crashing containers
# type = "console"
# inputs = [ "nomad-flags" ]
# encoding.codec = "logfmt"
# buffer.when_full = "drop_newest"
[sinks.loki]
type = "loki"
inputs = [ "nomad-flags" ]
Loading