private static LoggerOutput getMQLightOutput(String defaultOutput, String type) {
    String requiredOutput = System.getenv("MQLIGHT_JAVA_LOG_STREAM");
    if (requiredOutput == null || requiredOutput.trim().length() == 0) requiredOutput = defaultOutput;
    final LoggerOutput result;
    if (requiredOutput.equals("stdout")) {
      result = new LoggerOutput(requiredOutput, "", System.out);
    } else if (requiredOutput.equals("stderr")) {
      result = new LoggerOutput(requiredOutput, "", System.err);
    } else {
      final String logFileCount = System.getenv("MQLIGHT_JAVA_LOG_FILE_COUNT");
      final String logFileLimit = System.getenv("MQLIGHT_JAVA_LOG_FILE_LIMIT");
      PrintStream outputStream = null;
      try {
        outputStream = new PrintStream(new File(requiredOutput+"."+type), outputEncoding);
      } catch (FileNotFoundException | UnsupportedEncodingException e) {
        final ClientRuntimeException exception =
            new ClientRuntimeException("Unable to log to file: \'" + requiredOutput+"."+type + "\': " + e.getLocalizedMessage());
        throw exception;
      }
      result = new LoggerOutput(requiredOutput, type, outputStream, logFileCount, logFileLimit);
    }

    return result;
  }
private static LoggerOutput getMQLightOutput ( String defaultOutput , String type ) { String requiredOutput = System . getenv ( "MQLIGHT_JAVA_LOG_STREAM" ) ; if ( requiredOutput == null || requiredOutput . trim ( ) . length ( ) == 0 ) requiredOutput = defaultOutput ; final LoggerOutput result ; if ( requiredOutput . equals ( "stdout" ) ) { result = new LoggerOutput ( requiredOutput , "" , System . out ) ; } else if ( requiredOutput . equals ( "stderr" ) ) { result = new LoggerOutput ( requiredOutput , "" , System . err ) ; } else { final String logFileCount = System . getenv ( "MQLIGHT_JAVA_LOG_FILE_COUNT" ) ; final String logFileLimit = System . getenv ( "MQLIGHT_JAVA_LOG_FILE_LIMIT" ) ; PrintStream outputStream = null ; try { outputStream = new PrintStream ( new File ( requiredOutput + "." + type ) , outputEncoding ) ; } catch ( FileNotFoundException | UnsupportedEncodingException e ) { final ClientRuntimeException exception = new ClientRuntimeException ( "Unable to log to file: \'" + requiredOutput + "." + type + "\': " + e . getLocalizedMessage ( ) ) ; throw exception ; } result = new LoggerOutput ( requiredOutput , type , outputStream , logFileCount , logFileLimit ) ; } return result ; }
Obtains the required logger output information, for the required log type, based on environment settings.
<p>
Environment variable: {@code MQLIGHT_JAVA_LOG_STREAM} can be defined to specify the logger output destination path.
A value of {@code stdout} or {@code stderr} can be specified to define stdout or stderr, respectively.
<p>
Environment variable: {@code MQLIGHT_JAVA_LOG_FILE_COUNT} can be defined to specify the maximum number of archive log files to keep. If not specified then a default of 5 is used.
<p>
Environment variable: {@code MQLIGHT_JAVA_LOG_FILE_LIMIT} can be defined to specify the maximum size of the log file before it is renamed to a archive log file. If not specified then a default of 20MB is used.
<p>
When {@code MQLIGHT_JAVA_LOG_STREAM} specifies a file path the output log file path will be in the format:
{@code MQLIGHT_JAVA_LOG_STREAM%i.type} where {@code %i} is blank for the active log file and ranging from 1 to the defined {@code MQLIGHT_JAVA_LOG_FILE_COUNT} for the archive log files.

@param defaultOutput The default output for the logger information.
@param type The type of log output. This is used as the extension, when logging to file.
@return A {@link LoggerOutput} containing the required logger information.