Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] stdout destination is ignored #29

Closed
1 task done
fedinskiy opened this issue Sep 23, 2024 · 2 comments · Fixed by #30
Closed
1 task done

[BUG] stdout destination is ignored #29

fedinskiy opened this issue Sep 23, 2024 · 2 comments · Fixed by #30
Assignees
Labels
bug Something isn't working

Comments

@fedinskiy
Copy link

fedinskiy commented Sep 23, 2024

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
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Sep 23, 2024

In the short term you can probably use https://github.com/linuxserver/docker-mods/tree/universal-stdout-logs to achieve this, but I'll look at adding an option to log to stdout rather than file, which should solve this in a cleaner way.

@thespad thespad self-assigned this Sep 23, 2024
@thespad thespad added the bug Something isn't working label Sep 23, 2024
@thespad thespad mentioned this issue Sep 23, 2024
1 task
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants