{"record":{"id":"8ee80a4522d0af3d","repo":"puppetlabs/puppet","slug":"invalid-syslog-facility-str","errorCode":null,"errorMessage":"Invalid syslog facility %{str}","messagePattern":"Invalid syslog facility %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/util/log/destinations.rb","lineNumber":23,"sourceCode":"    Puppet.features.syslog?\n  end\n\n  def close\n    Syslog.close\n  end\n\n  def initialize\n    Syslog.close if Syslog.opened?\n    name = \"puppet-#{Puppet.run_mode.name}\"\n\n    options = Syslog::LOG_PID | Syslog::LOG_NDELAY\n\n    # XXX This should really be configurable.\n    str = Puppet[:syslogfacility]\n    begin\n      facility = Syslog.const_get(\"LOG_#{str.upcase}\")\n    rescue NameError => e\n      raise Puppet::Error, _(\"Invalid syslog facility %{str}\") % { str: str }, e.backtrace\n    end\n\n    @syslog = Syslog.open(name, options, facility)\n  end\n\n  def handle(msg)\n    # XXX Syslog currently has a bug that makes it so you\n    # cannot log a message with a '%' in it.  So, we get rid\n    # of them.\n    if msg.source == \"Puppet\"\n      msg.to_s.split(\"\\n\").each do |line|\n        @syslog.send(msg.level, line.gsub(\"%\", '%%'))\n      end\n    else\n      msg.to_s.split(\"\\n\").each do |line|\n        @syslog.send(msg.level, \"(%s) %s\" % [msg.source.to_s.delete(\"%\"),\n                                             line.gsub(\"%\", '%%')])\n      end","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/util/log/destinations.rb#L5-L41","documentation":"Error \"Invalid syslog facility %{str}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/util/log/destinations.rb:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}