Reopen the associated static logging stream. Set to null to redirect to System.out.
438535
public static void openLogFile(String logPath) {
		if (logPath == null) {
			printStream = System.out;
		} else {
			try {
				printStream = new PrintStream(new File(logPath));
			} catch (FileNotFoundException e) {
				throw new IllegalArgumentException("Log file " + logPath + " was not found", e);
			}
		}
	}
8959
protected function attemptStreamRecovery()
    {
        if ('resource' === gettype($this->stream))
        {
            @fflush($this->stream);
            @fclose($this->stream);
        }

        $this->stream = fopen($this->streamURI, $this->streamMode);
        if (false === $this->stream)
        {
            trigger_error(sprintf(
                '%s - Unable to write to "%s" and re-open attempt failed, will default to php-output',
                get_called_class(),
                $this->streamURI));

            $this->stream = $this->defaultStream();
        }
    }
1053856
def redirect_stdout(self, enabled=True, log_level=logging.INFO):
        
        if enabled:
            if self.__stdout_wrapper:
                self.__stdout_wrapper.update_log_level(log_level=log_level)
            else:
                self.__stdout_wrapper = StdOutWrapper(logger=self, log_level=log_level)

            self.__stdout_stream = self.__stdout_wrapper
        else:
            self.__stdout_stream = _original_stdout

        # Assign the new stream to sys.stdout
        sys.stdout = self.__stdout_stream
74377
def log_to_stream(stream=sys.stderr, level=logging.NOTSET,
                  fmt=logging.BASIC_FORMAT):
    
    fmt = Formatter(fmt)
    handler = StreamHandler()
    handler.setFormatter(fmt)
    handler.setLevel(level)

    log.addHandler(handler)
719094
private void doResume(long id) {
    if (paused) {
      log.debug(String.format("%s - Resumed connection to %s", this, context.target()));
      paused = false;
      checkDrain();
    }
  }
839782
public synchronized void start()
    {
        _buffer=new ByteArrayISO8859Writer(_bufferSize);
        _reopen=false;
        if (_started)
            return;
        
        if (_out==null && _filename!=null)
        {
            try
            {
                RolloverFileOutputStream rfos=
                    new RolloverFileOutputStream(_filename,_append,_retainDays);
                _out=rfos;
            }
            catch(IOException e){e.printStackTrace();}   
        }

        if (_out==null)
            _out=LogStream.STDERR_STREAM;
        
        _started=true;
    }
303870
public void dump() throws InvocationException {
		if (_updated) {
			synchronized (_lock) {
				if (!_updated)
					return;

				List<LogMessage> messages = _cache;
				_cache = new ArrayList<LogMessage>();

				save(messages);

				_updated = false;
				_lastDumpTime = System.currentTimeMillis();
			}
		}
	}
1285236
def reopen(self):
        """"""
        # If the connection is already back in the pool,
        # get another connection from the pool,
        # otherwise reopen the underlying connection.
        if self._con:
            self._con.reopen()
        else:
            self._con = self._pool.connection()
489401
protected void redirectSystemOutAndErr(boolean force) {
        if (force || !(System.out instanceof ConsolePrintStream)) {
            System.setOut(new ConsolePrintStream(out));
        }
        if (force || !(System.err instanceof ConsoleErrorPrintStream)) {
            System.setErr(new ConsoleErrorPrintStream(err));
        }
    }
1018243
private void resetLogger(Logger logger) {
        // Close all the Logger's handlers.
        Handler[] targets = logger.getHandlers();
        for (int i = 0; i < targets.length; i++) {
            Handler h = targets[i];
            logger.removeHandler(h);
            try {
                h.close();
            } catch (Exception ex) {
                // Problems closing a handler?  Keep going...
            }
        }
        String name = logger.getName();
        if (name != null && name.equals("")) {
            // This is the root logger.
            logger.setLevel(defaultLevel);
        } else {
            logger.setLevel(null);
        }
    }
457517
def resume_session_logging(self):
        """"""
        self._chain.ctrl.set_session_log(self.session_fd)
        self.log("Session logging resumed")
1243732
def redirect_output(fileobj):
    """"""
    old = sys.stdout
    sys.stdout = fileobj
    try:
        yield fileobj
    finally:
        sys.stdout = old
1138791
public synchronized void close() throws IOException {
        if (logStream != null) {
            logStream.close();
        }
        for (FileOutputStream log : streamsToFlush) {
            log.close();
        }
    }
998585
synchronized void open() throws IOException {
    if (syncer == null) {
      syncer = new SyncThread();
      syncThread = new Thread(syncer);
      syncThread.start();
    }
    if (state != State.BETWEEN_LOG_SEGMENTS)
      throw new IOException("Bad state: " + state);

    startLogSegment(getLastWrittenTxId() + 1, true);
    if (state != State.IN_SEGMENT)
      throw new IOException("Bad state: " + state);
  }
1302169
private void openLog() {

        if (filesReadOnly) {
            return;
        }

        try {
            dbLogWriter = ScriptWriterBase.newScriptWriter(database,
                    logFileName, false, false,
                    ScriptWriterBase.SCRIPT_TEXT_170);

            dbLogWriter.setWriteDelay(writeDelay);
            dbLogWriter.start();
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR, logFileName);
        }
    }
1328276
public OutputStream reset(OutputStream out)
            throws IOException
    {
        OutputStream old = this.out;
        this.out = out;
        return old;
    }
713355
public void restore() throws IOException
   {
      SpoolConfig spoolConfig = new SpoolConfig(fileCleaner);

      List<ItemState> listItemState = itemDataChangesLog.getAllStates();
      for (int i = 0; i < this.listFixupStream.size(); i++)
      {
         ItemState itemState = listItemState.get(listFixupStream.get(i).getItemSateId());
         ItemData itemData = itemState.getData();

         PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
         ValueData vd = (propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));

         // re-init the value
         propertyData.getValues().set(listFixupStream.get(i).getValueDataId(),
            new StreamPersistedValueData(vd.getOrderNumber(), listFile.get(i), spoolConfig));
      }

      if (listRandomAccessFile != null)
         for (int i = 0; i < listRandomAccessFile.size(); i++)
            listRandomAccessFile.get(i).close();

      for (int i = 0; i < listFile.size(); i++)
         fileCleaner.addFile(listFile.get(i));
   }