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.


access_log /dev/stdout l2met;

Doesn't work:

access_log syslog:server=localhost:9000 l2met;
  • 4
    What's your nginx version? – Alexey Ten Aug 29 '17 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 '17 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. – Justin Thomas Sep 3 '17 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 '17 at 19:59
  • I'm using nc there is no syslog config. Was trying to verify data shows up. – Justin Thomas Sep 7 '17 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.