--- proxydispatcher.py	2005-12-14 14:49:43.000000000 -0800
+++ ../mediaproxy-hacked/proxydispatcher.py	2007-06-14 22:13:02.000000000 -0700
@@ -56,7 +56,7 @@
     ## We test for this after we fork because we want the message to go to syslog if we fork
     shouldStart = getOption('Dispatcher', 'start', True, otype=Boolean)
     if not shouldStart:
-        print "disabled from configuration"
+        print >>sys.stderr, "disabled from configuration"
         sys.exit(0)
     
     ## Import the dispatcher only after we fork, as it loads the accounting module which
@@ -67,9 +67,9 @@
     try:
         config = dispatcher.DispatcherConfig
         ## Show some info on startup about the current settings
-        print "Listening for commands on local socket `%s'" % config.socket
+        print >>sys.stderr, "Listening for commands on local socket `%s'" % config.socket
         if config.listen is not None:
-            print "Listening for mediaproxy media timeout requests on %s:%s" % config.listen
+            print >>sys.stderr, "Listening for mediaproxy media timeout requests on %s:%s" % config.listen
         plural = " is"
         defaultProxy = config.defaultProxy
         domainId = 'domain://'
@@ -82,7 +82,7 @@
             plural = "s are"
         else:
             where = "on `%s'" % defaultProxy
-        print "Default mediaproxy server%s %s" % (plural, where)
+        print >>sys.stderr, "Default mediaproxy server%s %s" % (plural, where)
 
         dispatcher.start()
     except dispatcher.DispatcherError, why:
--- mediaproxy.py	2005-12-14 14:50:36.000000000 -0800
+++ ../mediaproxy-hacked/mediaproxy.py	2007-06-14 22:13:48.000000000 -0700
@@ -48,8 +48,8 @@
 
     proxyIP = getOption('MediaProxy', 'proxyIP', thisHostIP, IPAddress)
     if not proxyIP:
-        print "Cannot determine the IP address of this host!"
-        print "Please specify one in the configuration file."
+        print >>sys.stderr, "Cannot determine the IP address of this host!"
+        print >>sys.stderr, "Please specify one in the configuration file."
         sys.exit(1)
 
     if options.fork:
@@ -62,7 +62,7 @@
     ## We test for this after we fork because we want the message to go to syslog if we fork
     shouldStart = getOption('MediaProxy', 'start', True, otype=Boolean)
     if not shouldStart:
-        print "disabled from configuration"
+        print >>sys.stderr, "disabled from configuration"
         sys.exit(0)
 
     ## Import rtphandler only after we fork, as it loads the accounting module which
@@ -77,27 +77,27 @@
         if proxyConfig.socket:
             handler = rtphandler.ControlSocket()
         where = handler and ("`%s'" % proxyConfig.socket) or "is disabled"
-        print "Listening for commands on local socket %s" % where
+        print >>sys.stderr, "Listening for commands on local socket %s" % where
 
         ## Start remote command handler if requested
         if proxyConfig.listen is not None:
             handler = rtphandler.RemoteControl()
-            print "Listening for remote commands on `%s:%s'" % proxyConfig.listen
+            print >>sys.stderr, "Listening for remote commands on `%s:%s'" % proxyConfig.listen
             where = handler.aclStr()
             if where == 'anywhere':
                 where = "anywhere!!! beware!"
-            print "Remote commands are allowed from: %s" % where
+            print >>sys.stderr, "Remote commands are allowed from: %s" % where
         else:
-            print "Listening for remote commands is disabled"
+            print >>sys.stderr, "Listening for remote commands is disabled"
 
         ## Print some more startup info
         if handler:
-            print "Using IP address `%s' for the RTP/RTCP proxy" % proxyIP
+            print >>sys.stderr, "Using IP address `%s' for the RTP/RTCP proxy" % proxyIP
         else:
-            print "No control sockets defined! Cannot receive any command at all. Exiting."
+            print >>sys.stderr, "No control sockets defined! Cannot receive any command at all. Exiting."
 
         if proxyConfig.forceClose > 0:
-            print "Sessions will be forcefully closed after %s seconds" % proxyConfig.forceClose
+            print >>sys.stderr, "Sessions will be forcefully closed after %s seconds" % proxyConfig.forceClose
 
         ## Start main loop. Note that this will return immediately and exit if no control
         ## sockets are defined at all. this is why there is no sys.exit() above
--- modules/daemon.py	2005-10-25 13:39:32.000000000 -0700
+++ ../mediaproxy-hacked/modules/daemon.py	2007-06-14 22:18:07.000000000 -0700
@@ -10,7 +10,7 @@
 
 
 class Redirect:
-    def __init__(self, which, where, syslog=0):
+    def __init__(self, which, where, syslog=0, priority=syslog.LOG_INFO):
         if not which in ['stdin', 'stdout', 'stderr']:
             raise ValueError, "Should be one of 'stdin', 'stdout' or 'stderr'"
         if which == 'stdin':
@@ -22,6 +22,7 @@
         self.lock = threading.Lock()
         self.which = which
         self.syslog = syslog
+        self.priority = priority
 
     def write(self, s):
         self.lock.acquire()
@@ -33,14 +34,14 @@
                 ## We want to print multilines one at a time, but ignore empty lines
                 for line in [l for l in s.splitlines() if l]:
                     try:
-                        syslog.syslog(line)
+                        syslog.syslog(self.priority, line)
                     except TypeError:
                         ## This is a binary string containing \x00 which we need to escape 
                         if type(line) is unicode:
                             escape = 'unicode_escape'
                         else:
                             escape = 'string_escape'
-                        syslog.syslog(line.strip().encode(escape))
+                        syslog.syslog(self.priority, line.strip().encode(escape))
         finally:
             self.lock.release()
 
@@ -154,8 +155,8 @@
         os.close(2)
 
         sys.stdin  = Redirect('stdin', None)
-        sys.stdout = Redirect('stdout', log, useSyslog)
-        sys.stderr = Redirect('stderr', log, useSyslog)
+        sys.stdout = Redirect('stdout', log, useSyslog, syslog.LOG_INFO)
+        sys.stderr = Redirect('stderr', log, useSyslog, syslog.LOG_ERR)
         self.__logFile = log
 
         ## Ignore Terminal I/O Signals
--- modules/utilities.py	2006-03-29 08:27:45.000000000 -0800
+++ ../mediaproxy-hacked/modules/utilities.py	2007-06-14 21:16:54.000000000 -0700
@@ -17,7 +17,7 @@
 ## Helper functions
 
 def info(msg):
-    print >>sys.stderr, "info: " + str(msg)
+    print >>sys.stdout, "info: " + str(msg)
 
 def warning(msg):
     print >>sys.stderr, "warning: " + str(msg)
