'Create and return a suitable log observer for the given configuration.
The observer will go to syslog using the prefix C{_syslogPrefix} if
C{_syslog} is true.  Otherwise, it will go to the file named
C{_logfilename} or, if C{_nodaemon} is true and C{_logfilename} is
C{"-"}, to stdout.
@return: An object suitable to be passed to C{log.addObserver}.'

def _getLogObserver(self):

    if self._syslog:
        from twisted.python import syslog
        return syslog.SyslogObserver(self._syslogPrefix).emit
    if (self._logfilename == '-'):
        if (not self._nodaemon):
            sys.exit('Daemons    cannot    log    to    stdout,    exiting!')
        logFile = sys.stdout
    elif (self._nodaemon and (not self._logfilename)):
        logFile = sys.stdout
    else:
        if (not self._logfilename):
            self._logfilename = 'twistd.log'
        logFile = logfile.LogFile.fromFullPath(self._logfilename)
        try:
            import signal
        except ImportError:
            pass
        else:
            if (not signal.getsignal(signal.SIGUSR1)):
                def rotateLog(signal, frame):
                    from twisted.internet import reactor
                    reactor.callFromThread(logFile.rotate)
                signal.signal(signal.SIGUSR1, rotateLog)
    return logger.textFileLogObserver(logFile)
