Alloy - Do not send Alloy logs to syslog

Hello,

I have installed some Alloy agents recently, and have an issue with the syslog.
All Alloy logs have been written to the default syslog on Linux.

I have made a basic log configuration for Alloy, but despite this the logs continue to being written to the host syslog.
Here is the Alloy logging part in my config.alloy file :

logging {
    level  = "debug"
    format = "logfmt"
    write_to = [loki.process.alloy_logs.receiver]
}

loki.process "alloy_logs" {
    forward_to = [loki.relabel.global_label.receiver]

    stage.static_labels {
        values = {
            service_name = "alloy",
        }
    }
}

Thanks for your help !

It seems that I’ve found the issue : my journald.conf indicates to follows all logs to SysLog (by default).
I will check that and modify this post in “solved” if all works as intended.

The issue is now solved : I give up on the “debug” level of the logs.
When setting it to “info” the logs stop spamming my SysLog. Simplest way, but efficient !

But, if someone have a solution to set a log file for all Alloy logs, I will be glad.

maybe this? how are you runnning alloy? systemd or a container?

logging {
  level  = "info"
  format = "logfmt"
}

where does alloy write to

Alloy is running with systemd,
I see that I can redirect the log output if I run it in single binary, with a declaration in /etc/systemd/

Since I put “level = info” my Syslog is less spammed, I think that will be ok like this.

1 Like