Package org.pentaho.platform.util.logging

Examples of org.pentaho.platform.util.logging.SimpleLogger


    } catch ( ClassNotFoundException e1 ) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    ILogger l = new SimpleLogger( this );
    IPentahoSession session = getSession();
    setGlobalParams();
    this.sessionStartup( session );
    Document doc = null;
    try {
View Full Code Here


    Assert.assertTrue( true );
  }

  public void testSimpleLogger() {

    SimpleLogger logger = new SimpleLogger( LogTest.class );

    logger.setLoggingLevel( ILogger.WARN );
    int logLevel = logger.getLoggingLevel();
    String logLevelName = logger.getLogLevelName( logLevel );
    int logLevelWithParam = logger.getLogLevel( logLevelName );
    Assert.assertEquals( logLevelWithParam, ILogger.WARN );

    logger.warn( "This is a warning with class as an object" + ILogger.WARN ); //$NON-NLS-1$
    logger.warn( "This is a warning with class as an object" + +ILogger.WARN, new Throwable() ); //$NON-NLS-1$

    logger.debug( "This is a debug with class as an object" + ILogger.DEBUG ); //$NON-NLS-1$
    logger.debug( "This is a debug with class as an object" + ILogger.DEBUG, new Throwable() ); //$NON-NLS-1$

    logger.error( "This is a error with class as an object" + ILogger.ERROR ); //$NON-NLS-1$
    logger.error( "This is a error with class as an object" + ILogger.ERROR, new Throwable() ); //$NON-NLS-1$

    logger.fatal( "This is a fatal with class as an object" + ILogger.FATAL ); //$NON-NLS-1$
    logger.fatal( "This is a fatal with class as an object" + ILogger.FATAL, new Throwable() ); //$NON-NLS-1$

    logger.info( "This is an info with class as an object" + ILogger.INFO ); //$NON-NLS-1$
    logger.info( "This is an info with class as an object" + ILogger.INFO, new Throwable() ); //$NON-NLS-1$

    logger.trace( "This is a trace with class as an object" + ILogger.TRACE, new Throwable() ); //$NON-NLS-1$
    logger.trace( "This is a trace with class as a string" + ILogger.TRACE, new Throwable() ); //$NON-NLS-1$
    logger.trace( "This is a trace test" ); //$NON-NLS-1$

    Assert.assertTrue( true );
  }
View Full Code Here

    try {
      IPentahoSession session = PentahoSessionHolder.getSession();
      if ( databaseMeta.getAccessType() == DatabaseMeta.TYPE_ACCESS_JNDI ) {
        String jndiName = databaseMeta.getDatabaseName();
        if ( jndiName != null ) {
          SimpleLogger simpleLogger = new SimpleLogger( this );
          localConnection =
              (SQLConnection) PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName,
                  session, simpleLogger );
        }
      }
      if ( localConnection == null ) {
        String driver = databaseMeta.getDriverClass();
        String userId = databaseMeta.getUsername();
        String password = databaseMeta.getPassword();
        String connectionInfo = databaseMeta.getURL();

        // Fix for BISERVER-6350
        // Creating connections in PEC generate GenericDatabaseMeta objects that lack the DatabaseName (since
        // GenericDatabaseMeta use a "custom URL" instead).
        // Later on when the db dialect of the database meta gets changed (this.getActiveDatabaseMeta()) to other than
        // the "Generic" the
        // DatabaseName is still missing which produces a bougus url connection throwing exceptions.

        if ( StringUtils.isEmpty( databaseMeta.getDatabaseName() ) ) {
          String genericDBMetaDriver =
              databaseMeta.getAttributes().getProperty( GenericDatabaseMeta.ATRRIBUTE_CUSTOM_DRIVER_CLASS, "" );
          if ( !StringUtils.isEmpty( genericDBMetaDriver ) ) {
            driver = genericDBMetaDriver;
          }
          String genericDBMetaURL =
              databaseMeta.getAttributes().getProperty( GenericDatabaseMeta.ATRRIBUTE_CUSTOM_URL, "" );
          if ( !StringUtils.isEmpty( genericDBMetaURL ) ) {
            connectionInfo = genericDBMetaURL;
          }
        }

        SimpleLogger simpleLogger = new SimpleLogger( this );
        localConnection =
            (SQLConnection) PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, driver,
                connectionInfo, userId, password, session, simpleLogger );
      }
View Full Code Here

  private String getPluginName() {
    return CdeEnvironment.getPluginId();
  }

  private ILogger getAuditLogger() {
    return new SimpleLogger( RenderApi.class.getName() );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.util.logging.SimpleLogger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.