code: public final PrintWriter getLogWriter() throws ResourceException {
          if (dataSourceOrDriver == null) {
              return logWriter;
          }
          try {
              if(!Driver.class.equals(type)) {
                  return ((CommonDataSource) dataSourceOrDriver).getLogWriter();
              }
              //Return null for Driver since that is the default value which can't be modified
              return null;
          } catch (SQLException se) {
              FFDCFilter.processException(se, getClass().getName(), "1656", this);
              throw AdapterUtil.translateSQLException(se, this, false, getClass());
          }
      }
docs: Get the log writer for this ManagedConnectionFactory instance.
  <p>
  The log writer is a character output stream to which all logging and tracing
  messages for this ManagedConnectionFactory instance will be printed
  <p>
  ApplicationServer manages the association of output stream with the
  ManagedConnectionFactory. When a ManagedConnectionFactory object is created the
  log writer is initially null, in other words, logging is disabled.
  
  @return a PrintWriter
  @exception ResourceException - Possible causes for this exception are:
  1) getLogWriter on the dataSource failed