1

We are using nc to listen to a port:

nc -kluvw 0 localhost 9000

Using nc to send a message:

echo "hi" | nc -u localhost 9000

This will print "Hi" on the server.

However, when setting up the access log as a syslog logger it won't log anything. Logging to /dev/stdout works.

Works:

access_log /dev/stdout l2met;

Doesn't work:

access_log syslog:server=localhost:9000 l2met;
5
  • 4
    What's your nginx version?
    – Alexey Ten
    Aug 29, 2017 at 8:37
  • 1
    In your /etc/syslog.conf, what file (and severity filtering) to you have configured for these local7 facility logs? I.e. could syslog be filtering out the (default) info-level access_log messages (or ignoring the local7 facility), and if so, would adding the severity= or facility= nginx syslog parameters help?
    – Castaglia
    Sep 3, 2017 at 17:03
  • I have a newer nginx. I got it working, but am unclear why it works now. I wasn't using syslog. I was trying to verify that nginx was sending data to a listening UDP port. See the nc command at the start of the question? Was doing a sanity check since I couldn't see the output with syslog. Sep 3, 2017 at 17:13
  • Which syslog do you use? please can you share the syslog config. can you try to set facility=daemon and see if in the daemon log are some nginx log entry?
    – Aleksandar
    Sep 7, 2017 at 19:59
  • I'm using nc there is no syslog config. Was trying to verify data shows up. Sep 7, 2017 at 21:14

0

You must log in to answer this question.

Browse other questions tagged .