Feature #676
closedSyslog support
Description
Smart-Proxy should be able to log to a standard syslog daemon.
Especially in an IT landscape with a large number of nodes you usually have a centralized logging infrastructure and Smart-Proxy should be able to use that if possible. Currently it only supports the output channels of Ruby's Logger class, which is a plain text file or STDOUT
.
Updated by Ohad Levy over 13 years ago
Syslog support in Ruby seems farily simple.
we can probably replace the custom logger with syslog directly:
require 'syslog' Syslog.open("foreman-proxy") Syslog.err "something bad happened" Syslog.close
Updated by Benjamin Papillon about 12 years ago
I clicked on the wrong button to vote. Too bad I didnt find how to revoke my vote :(
Updated by cristian falcas over 10 years ago
I was wandering if this was implemented after all or not?
Updated by Lukas Zapletal about 10 years ago
- Related to Feature #8006: Implement logging to stdout/stderr added
Updated by Byron Miller over 9 years ago
- Status changed from New to Resolved
Foreman Proxy now allows you to define STDOUT as a log output in /etc/foreman-proxy/settings.yml. On systemd this will output to /var/log/messages or whatever you have defined for the service in systemd.
Systemd manpage:
StandardOutput=
Controls where file descriptor 1 (STDOUT) of the executed processes is connected to. Takes one of inherit, null, tty, journal, syslog, kmsg, journal+console, syslog+console, kmsg+console or socket.
inherit duplicates the file descriptor of standard input for standard output.
null connects standard output to /dev/null, i.e. everything written to it will be lost.
tty connects standard output to a tty (as configured via TTYPath=, see below). If the TTY is used for output only, the executed process will not become the controlling process of the terminal, and will not fail or wait for other processes to release the terminal.
journal connects standard output with the journal which is accessible via journalctl(1). Note that everything that is written to syslog or kmsg (see below) is implicitly stored in the journal as well, the specific two options listed below are hence supersets of this one.
syslog connects standard output to the syslog(3) system syslog service, in addition to the journal. Note that the journal daemon is usually configured to forward everything it receives to syslog anyway, in which case this option is no different from journal.
kmsg connects standard output with the kernel log buffer which is accessible via dmesg(1), in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which case this option is no different from journal.
journal+console, syslog+console and kmsg+console work in a similar way as the three options above but copy the output to the system console as well.
socket connects standard output to a socket acquired via socket activation. The semantics are similar to the same option of StandardInput=.
This setting defaults to the value set with DefaultStandardOutput= in systemd-system.conf(5), which defaults to journal.
Updated by Lukas Zapletal about 9 years ago
- Related to Refactor #11323: Refactor PID writing, interrupt trap and daemon logging added
Updated by Lukas Zapletal almost 7 years ago
- Related to Feature #21807: Smart proxy status does not report pulp errors added