0

I am trying to figure which package (if any) I need to install on an Alpine docker image in order for the logger command to support the --udp flag.

By default, the logger command in alpine only supports a very minimal set of flags, and I need the --udp support.

# logger --help
BusyBox v1.28.4 (2018-05-30 10:45:57 UTC) multi-call binary.

Usage: logger [OPTIONS] [MESSAGE]

Write MESSAGE (or stdin) to syslog

        -s      Log to stderr as well as the system log
        -t TAG  Log using the specified tag (defaults to user name)
        -p PRIO Priority (numeric or facility.level pair)

I know there are rsyslog and syslog-ng alternatives, but I was hoping to get the Alpine container to behave exactly like my Ubuntu, at least in the logger perspective.

Thanks in advance.

DannyB
  • 143
  • 7
  • 1
    You don't. BusyBox logger can only write to the local syslog, not remote syslog servers. If you really need to write to remote syslog servers, then you should probably use something other than alpine. Of course, since it's in a Docker image you probably ought to let Docker handle all the logging anyway. – Michael Hampton Jan 02 '19 at 14:06
  • That's disappointing.... I need more granular and specific implementation then what I can do with docker logging. – DannyB Jan 02 '19 at 15:10

1 Answers1

2

I had the same problem, just add at your Dockerfile :

RUN apk add -U util-linux
valiano
  • 538
  • 4
  • 10