@Override public LogLevel getLogLevel() { return log != null ? log.getLogLevel() : null; }
public Job() { init(); this.log = new LogChannel( this ); this.logLevel = log.getLogLevel(); }
public PurRepositoryConnector( PurRepository purRepository, PurRepositoryMeta repositoryMeta, RootRef rootRef ) { log = new LogChannel( this.getClass().getSimpleName() ); if ( purRepository != null && purRepository.getLog() != null ) { log.setLogLevel( purRepository.getLog().getLogLevel() ); } this.purRepository = purRepository; this.repositoryMeta = repositoryMeta; this.rootRef = rootRef; }
public Job( Repository repository, JobMeta jobMeta, LoggingObjectInterface parentLogging ) { this.rep = repository; this.jobMeta = jobMeta; this.containerObjectId = jobMeta.getContainerObjectId(); this.parentLoggingObject = parentLogging; init(); jobTracker = new JobTracker( jobMeta ); this.log = new LogChannel( this, parentLogging ); this.logLevel = log.getLogLevel(); if ( this.containerObjectId == null ) { this.containerObjectId = log.getContainerObjectId(); } }
public Repository connectRepository( String repositoryName, String username, String password ) throws KettleException { // Verify that the repository exists on the slave server... // RepositoriesMeta repositoriesMeta = new RepositoriesMeta(); repositoriesMeta.getLog().setLogLevel( log.getLogLevel() ); try { repositoriesMeta.readData(); } catch ( Exception e ) { throw new KettleException( "Unable to get a list of repositories to locate repository '" + repositoryName + "'" ); } return connectRepository( repositoriesMeta, repositoryName, username, password ); }
/** * Construct a new Database Connection * * @param databaseMeta The Database Connection Info to construct the connection with. * @deprecated Please specify the parent object so that we can see which object is initiating a database connection */ @Deprecated public Database( DatabaseMeta databaseMeta ) { this.parentLoggingObject = null; this.databaseMeta = databaseMeta; shareVariablesWith( databaseMeta ); // In this case we don't have the parent object, so we don't know which // object makes the connection. // We also don't know what log level to attach to it, so we have to stick to // the default // As such, this constructor is @deprecated. // log = new LogChannel( this ); logLevel = log.getLogLevel(); containerObjectId = log.getContainerObjectId(); pstmt = null; rowMeta = null; dbmd = null; rowlimit = 0; written = 0; opened = copy = 0; if ( log.isDetailed() ) { log.logDetailed( "New database connection defined" ); } }
/** * Sets the parent logging object. * * @param parent the new parent */ public void setParent( LoggingObjectInterface parent ) { this.parent = parent; this.log = new LogChannel( this, parent ); this.logLevel = log.getLogLevel(); if ( this.containerObjectId == null ) { this.containerObjectId = log.getContainerObjectId(); } if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.TransformationIsPreloaded" ) ); } if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "Trans.Log.NumberOfStepsToRun", String.valueOf( transMeta.nrSteps() ), String.valueOf( transMeta.nrTransHops() ) ) ); } }
log.logMinimal( BaseMessages.getString( PKG, "Pan.Log.Loglevel", log.getLogLevel().getDescription() ) );
public RepositoriesMeta loadRepositoryInfo( String loadingAvailableRepMsgTkn, String noRepsDefinedMsgTkn ) throws KettleException { RepositoriesMeta repsinfo = new RepositoriesMeta(); repsinfo.getLog().setLogLevel( getLog().getLogLevel() ); logDebug( loadingAvailableRepMsgTkn ); try { repsinfo.readData(); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( getPkgClazz(), noRepsDefinedMsgTkn ), e ); } return repsinfo; }
public Repository establishRepositoryConnection( RepositoryMeta repositoryMeta, final String username, final String password, final RepositoryOperation... operations ) throws KettleException, KettleSecurityException { Repository rep = PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, repositoryMeta, Repository.class ); rep.init( repositoryMeta ); rep.getLog().setLogLevel( getLog().getLogLevel() ); rep.connect( username != null ? username : null, password != null ? password : null ); if ( operations != null ) { // throws KettleSecurityException if username does does have permission for given operations rep.getSecurityProvider().validateAction( operations ); } return rep; }
private void connectRep( LogChannelInterface log, String realrepName, String realusername, String realpassword ) throws Exception { this.repsinfo = new RepositoriesMeta(); this.repsinfo.getLog().setLogLevel( log.getLogLevel() ); try { this.repsinfo.readData(); } catch ( Exception e ) { logError( BaseMessages.getString( PKG, "JobExportRepository.Error.NoRep" ) ); throw new Exception( BaseMessages.getString( PKG, "JobExportRepository.Error.NoRep" ) ); } this.repositoryMeta = this.repsinfo.findRepository( realrepName ); if ( this.repositoryMeta == null ) { logError( BaseMessages.getString( PKG, "JobExportRepository.Error.NoRepSystem" ) ); throw new Exception( BaseMessages.getString( PKG, "JobExportRepository.Error.NoRepSystem" ) ); } this.repository = PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, this.repositoryMeta, Repository.class ); this.repository.init( repositoryMeta ); try { this.repository.connect( realusername, realpassword ); } catch ( Exception e ) { logError( BaseMessages.getString( PKG, "JobExportRepository.Error.CanNotConnectRep" ) ); throw new Exception( BaseMessages.getString( PKG, "JobExportRepository.Error.CanNotConnectRep" ), e ); } }
private static void initLogging( CommandLineOption[] options ) throws KettleException { StringBuilder optionLogFile = getCommandLineOption( options, "logfile" ).getArgument(); StringBuilder optionLogLevel = getCommandLineOption( options, "level" ).getArgument(); // Set default Locale: Locale.setDefault( Const.DEFAULT_LOCALE ); if ( !Utils.isEmpty( optionLogFile ) ) { fileLoggingEventListener = new FileLoggingEventListener( optionLogFile.toString(), true ); if ( log.isBasic() ) { String filename = fileLoggingEventListener.getFilename(); log.logBasic( BaseMessages.getString( PKG, "Spoon.Log.LoggingToFile" ) + filename ); } KettleLogStore.getAppender().addLoggingEventListener( fileLoggingEventListener ); } else { fileLoggingEventListener = null; } if ( !Utils.isEmpty( optionLogLevel ) ) { log.setLogLevel( LogLevel.getLogLevelForCode( optionLogLevel.toString() ) ); if ( log.isBasic() ) { // "Logging is at level : " log.logBasic( BaseMessages.getString( PKG, "Spoon.Log.LoggingAtLevel" ) + log.getLogLevel().getDescription() ); } } }
/** * Construct a new Database Connection * * @param databaseMeta The Database Connection Info to construct the connection with. */ public Database( LoggingObjectInterface parentObject, DatabaseMeta databaseMeta ) { this.parentLoggingObject = parentObject; this.databaseMeta = databaseMeta; shareVariablesWith( databaseMeta ); if ( parentObject instanceof VariableSpace ) { shareVariablesWith( (VariableSpace) parentObject ); } log = new LogChannel( this, parentObject ); this.containerObjectId = log.getContainerObjectId(); this.logLevel = log.getLogLevel(); if ( parentObject != null ) { log.setGatheringMetrics( parentObject.isGatheringMetrics() ); } pstmt = null; rowMeta = null; dbmd = null; rowlimit = 0; written = 0; opened = copy = 0; if ( log.isDetailed() ) { log.logDetailed( "New database connection defined" ); } }
LogChannelInterface log = CarteSingleton.getInstance().getLog(); if ( log.isDetailed() ) { log.logDetailed( "Logging level set to " + log.getLogLevel().getDescription() );
repositoriesMeta.getLog().setLogLevel( log.getLogLevel() ); try { repositoriesMeta.readData();
if ( Utils.isEmpty( message ) || !getEntryLogLevel().isVisible( logChannel.getLogLevel() ) ) { return true;
purRepositoryConnector.getLog().setLogLevel( log.getLogLevel() );
job.setLogLevel( getLog().getLogLevel() ); job.getJobMeta().setInternalKettleVariables( job ); job.setRepository( repository );
if ( first ) { first = false; output = new GPLoadDataOutput( this, meta, log.getLogLevel() );
trans.setLogLevel( getLog().getLogLevel() ); configureParameters( trans, params, trans.getTransMeta() );