Skip to content

[BUG] stdout destination is ignored #29

Closed
@fedinskiy

Description

@fedinskiy

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I run this docker container with an option destination {stdout();}; in config , but the logs I send are not shown in stdout. They are written in the log file, though.

Expected Behavior

When I start the container with stdout destination[1] in configs, I expect the logs to be shown in the stdout of container.

[1] https://syslog-ng.github.io/admin-guide/070_Destinations/275_stdout/README exists since 4.4, currently this container uses 4.7.1

Steps To Reproduce

  1. Create a config
cat <<EOF >syslog-ng.conf
@version: 4.4
@include "scl.conf"

log {
	source {
		#network();
		tcp(ip(0.0.0.0) port(8514));
	};
	destination { file("/tmp/mylog"); };
	destination {stdout();};
};
EOF
  1. Start the container: podman run -p 8714:8514 -v $(pwd)/syslog-ng.conf:/config/syslog-ng.conf:z --name lserver --rm -it linuxserver/syslog-ng
  2. Send the log: echo "Hello syslog on linuxserver" | nc -w1 localhost 8714
  3. There is no message in the logs
  4. Check the log file in the container:
$ podman exec lserver 'cat' '/tmp/mylog'
Sep 23 11:43:48 localhost Hello syslog on linuxserver

For comparison, the same test succeeds on balabit syslog container:

podman run -p 8614:8514 -v $(pwd)/syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf:z --name balabit --rm -it balabit/syslog-ng
echo "Hello syslog on balabit" | nc -w1 localhost 8614
# Container stdout contains message "Sep 23 11:51:37 localhost Hello syslog on balabit" 
$ podman exec balabit 'cat' '/tmp/mylog'
Sep 23 11:51:37 localhost Hello syslog on balabit

Environment

- OS:Linux 6.10.8-200.fc40.x86_64
- How docker service was installed: package manager

CPU architecture

x86-64

Docker creation

Used the image from the docker hub:

docker.io/linuxserver/syslog-ng                                                              latest                         58a122665aa4  3 days ago     82.3 MB

Command is described in reporoducer



### Container logs

```bash
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────
Linuxserver.io version: 4.7.1-r1-ls128
Build-date: 2024-09-19T18:55:47+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
crond[157]: crond (busybox 1.36.1) started, log level 5
[ls.io-init] done.
^Ccrond[157]: USER root pid 191 cmd run-parts /etc/periodic/15min

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions