logging messages to error_log with "INFO:" does not work

Kurt Pfeifle kpfeifle at danka.de
Tue Jul 4 05:19:33 PDT 2006


  ------------------------------------------------------------------
  (This happens likewise on a Debian testing system cupsys 1.1.23-15
  as it does on a self-compiled system from Subversion trunk/r5706)
  ------------------------------------------------------------------

I'm trying to get the log level INFO to work with a self-written 
backend (a shell script to create a special type of PDFs).

My understanding is this: if I create output to stderr prepended
with the keywords "INFO:", "NOTICE:", "WARNING:", "DEBUG:",
"DEBUG2:", "CRIT:", "ERROR:", "ALERT:" or "EMERG:" then my output
should appear in the error_log (with the first character of the
line being "I", "N", "W", "D", "d", "C", "E", "A" or "X".

Well, it works for all levels as described -- but not for "INFO:" 

So my question is: What is different for "LogLevel info"? Is this a
bug? Or do I miss something obvious?


Here is the sample "dummy" backend I used for testing:

----------------- snip ------------------------------------------------
  #!/bin/bash
  # 
  # /usr/lib/cups/backend/dummy
  #
  # (by Kurt Pfeifle)
  #
  # This dummy backend writes the file to the path given as device URI
  # "dummy:/path/to/output/file" (where the respective directories need
  # to be already in existence)
  
  case ${#} in
     0)
        echo "file dummy \"Unknown\" \"Dummy backend to test logging\""
        exit 0
        ;;
     1|2|3|4)
        echo "Usage: dummy job-id user title copies options [file]"
        exit 0
        ;;
     5)
        cat - > ${DEVICE_URI#dummy:}
        ;;
     6)
        cat ${6} > ${DEVICE_URI#dummy:}
  esac
  
  echo "EMERG:  This is a \"emergency\" level log message" 1>&2
  echo "ALERT:  This is a \"alert\" level log message"     1>&2
  echo "CRIT:   This is a \"critical\" level log message"  1>&2
  echo "ERROR:  This is a \"error\" level log message"     1>&2
  echo "WARN:   This is a \"warn\" level log message"      1>&2
  echo "NOTICE: This is a \"notice\" level log message"    1>&2
  echo "INFO:   This is a \"info\" level log message"      1>&2
  echo "DEBUG:  This is a \"debug\" level log message"     1>&2
  echo "DEBUG2: This is a \"debug2\" level log message"    1>&2
----------------- snap ------------------------------------------------

Cheers,
Kurt


P.S.: For other readers wanting to test it, do this:
      a) copy the sample to /usr/lib/cups/backend/dummy
      b) make it executable: "chmod a+x /usr/lib/cups/backend/dummy"
      c) restart cupsd
      d) install a printer: "lpadmin -p dummyprn -v dummy:/dev/null -E"
         (be careful: if you do use a *real* file path+name instead of 
         /dev/null, it will be overwritten!)
      e) print: "lp -d dummyprn /etc/hosts"
      f) see error_log: "tail -n 20 /var/log/cups/error_log"





More information about the cups mailing list