Logging from the Lua scripts

To log messages with the main PowerDNS Recursor process, use pdnslog(). pdnslog() can also write out to a syslog loglevel if specified. Use pdnslog(message, pdns.loglevels.LEVEL) with the correct pdns.loglevels entry. Entries are listed in the following table:

pdnslog(message, level)

Log message` at the Info level if ``level is not set.

  • msg (str) – The message to log
  • level (int) – The log level to log at, see below.
  • All - pdns.loglevels.All
  • Alert - pdns.loglevels.Alert
  • Critical - pdns.loglevels.Critical
  • Error - pdns.loglevels.Error
  • Warning - pdns.loglevels.Warning
  • Notice - pdns.loglevels.Notice
  • Info - pdns.loglevels.Info
  • Debug - pdns.loglevels.Debug
  • None - pdns.loglevels.None