public static PrintStream redirectOutput(File newOutput) throws IOException { return redirectOutput(newOutput, true); }
/** * Redirects the standard out and standard err to the configured log file as specified in the GemFire distributed * system properties. * * @param distributedSystem the GemFire model for a distributed system. * @throws IOException if the standard out and err redirection was unsuccessful. */ protected void redirectOutput(final DistributedSystem distributedSystem) throws IOException { if (distributedSystem instanceof InternalDistributedSystem) { OSProcess.redirectOutput(((InternalDistributedSystem) distributedSystem).getConfig().getLogFile()); } }
protected void redirectOutputToLogFile(InternalDistributedSystem system) throws Exception { DistributionConfig config = system.getConfig(); OSProcess.redirectOutput(config.getLogFile()); }
/** * Redirects the standard out and standard err to the configured log file as specified in the GemFire distributed * system properties. * * @param distributedSystem the GemFire model for a distributed system. * @throws IOException if the standard out and err redirection was unsuccessful. */ protected void redirectOutput(final DistributedSystem distributedSystem) throws IOException { if (distributedSystem instanceof InternalDistributedSystem) { OSProcess.redirectOutput(((InternalDistributedSystem) distributedSystem).getConfig().getLogFile()); } }
private Agent createAgent(final Properties props) throws IOException, AdminException { DistributionManager.isDedicatedAdminVM = true; SystemFailure.setExitOK(true); final AgentConfigImpl config = new AgentConfigImpl(props); // see bug 43760 if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) { config.setLogFile(AgentConfigImpl.DEFAULT_LOG_FILE); } // LOG:TODO: redirectOutput called here OSProcess.redirectOutput(new File(config.getLogFile())); // redirect output to the configured log file return AgentFactory.getAgent(config); }
@Override protected void redirectOutputToLogFile(InternalDistributedSystem system) throws Exception { final AgentConfig config = getFabricServiceInstance().getConfig(); // see bug 43760 if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) { config.setLogFile(getBaseName(null) + ".log"); } // redirect output to the configured log file OSProcess.redirectOutput(new File(config.getLogFile())); }
private Agent createAgent(final Properties props) throws IOException, AdminException { DistributionManager.isDedicatedAdminVM = true; SystemFailure.setExitOK(true); final AgentConfigImpl config = createAgentConfig(props); // see bug 43760 if (config.getLogFile() == null || "".equals(config.getLogFile().trim())) { config.setLogFile(AgentConfigImpl.DEFAULT_LOG_FILE); } logger = config.getLogWriter(); OSProcess.redirectOutput(new File(config.getLogFile())); // redirect output to the configured log file return AgentFactory.getAgent(config); }
tmpFile = File.createTempFile("mlw", null, tmpLogDir); PrintStream tmpps = OSProcess.redirectOutput(tmpFile); PrintWriter oldPW = this.setTarget(new PrintWriter(tmpps,true)); if (oldPW != null) { PrintStream ps = OSProcess.redirectOutput(activeLogFile); PrintWriter oldPW = this.setTarget(new PrintWriter(ps, true), this.activeLogFile.length()); if (oldPW != null) {
tmpFile = File.createTempFile("mlw", null, tmpLogDir); PrintStream tmpps = OSProcess.redirectOutput(tmpFile, AlertAppender.getInstance().isAlertingDisabled()/* See #49492 */); PrintWriter oldPW = this.setTarget(new PrintWriter(tmpps,true)); if (oldPW != null) { PrintStream ps = OSProcess.redirectOutput(activeLogFile, AlertAppender.getInstance().isAlertingDisabled()); PrintWriter oldPW = this.setTarget(new PrintWriter(ps, true), this.activeLogFile.length()); if (oldPW != null) {
OSProcess.redirectOutput(system.getConfig().getLogFile());
OSProcess.redirectOutput(config.getLogFile()); } catch (IOException e) { logWriter.error(e);
OSProcess.redirectOutput(config.getLogFile()); } catch (IOException e) { logger.error(e);