当前位置: 首页>>代码示例>>Java>>正文


Java LogWriter.logDetailed方法代码示例

本文整理汇总了Java中org.pentaho.di.core.logging.LogWriter.logDetailed方法的典型用法代码示例。如果您正苦于以下问题:Java LogWriter.logDetailed方法的具体用法?Java LogWriter.logDetailed怎么用?Java LogWriter.logDetailed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.logging.LogWriter的用法示例。


在下文中一共展示了LogWriter.logDetailed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CreateRemoteFolder

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
/**
 * Create remote folder
 * 
 * @param sftpClient
 * @param foldername
 * @return true, if foldername is created
 */
private boolean CreateRemoteFolder(SFTPv3Client sftpClient, String foldername)
{
	LogWriter log = LogWriter.getInstance();
	boolean retval=false;
	
	if(!sshDirectoryExists(sftpClient, foldername))
	{
		try
		{
			sftpClient.mkdir(foldername, 0700);
			retval=true;
			if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobSSH2GET.Log.RemoteFolderCreated",foldername));
			
		}catch (Exception e)
		{
			log.logError(toString(), Messages.getString("JobSSH2GET.Log.Error.CreatingRemoteFolder",foldername));
		}
	}
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:28,代码来源:JobEntrySSH2GET.java

示例2: systemPing

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean systemPing(String hostname, int timeout,LogWriter log)
{
	boolean retval=false;
	
	InetAddress address=null;
   	try{
   		address=InetAddress.getByName(hostname);
    	if(address==null)
    	{
    		log.logError(toString(),Messages.getString("JobPing.CanNotGetAddress",hostname));
    		return retval;
    	}
   	
        if(log.isDetailed()) 
        {
        	log.logDetailed(toString(),Messages.getString("JobPing.HostName",address.getHostName()));
        	log.logDetailed(toString(),Messages.getString("JobPing.HostAddress",address.getHostAddress()));
        }
       	
        retval = address.isReachable(timeout);
    	}catch(Exception e)
    	{
    		log.logError(toString(),Messages.getString("JobPing.ErrorSystemPing",hostname,e.getMessage()));
    	}
		return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:JobEntryPing.java

示例3: SFTPConnect

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void SFTPConnect(LogWriter log,String realservername,String realusername,int realport,
		String realpassword, String realFTPDirectory) throws Exception
{
	// Create sftp client to host ...
	sftpclient = new SFTPClient(InetAddress.getByName(realservername), realport, realusername);
	//if(log.isDetailed()) log.logDetailed(toString(), "Opened SFTP connection to server ["+realServerName+"] on port ["+realServerPort+"] with username ["+realUsername+"]");

	// login to ftp host ...
	sftpclient.login(realpassword);
	
	// move to spool dir ...
	if (!Const.isEmpty(realFTPDirectory))
	{
		sftpclient.chdir(realFTPDirectory);
		if(log.isDetailed()) log.logDetailed(toString(), "Changed to directory ["+realFTPDirectory+"]");
	}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:JobEntryFTPDelete.java

示例4: displayResults

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void displayResults(LogWriter log)
{
	if(log.isDetailed()){
		log.logDetailed(toString(), "=======================================");
		log.logDetailed(toString(), Messages.getString("JobMoveFiles.Log.Info.FilesInError","" + NrErrors));
		log.logDetailed(toString(), Messages.getString("JobMoveFiles.Log.Info.FilesInSuccess","" + NrSuccess));
		log.logDetailed(toString(), "=======================================");
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:JobEntryMoveFiles.java

示例5: downloadFile

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void downloadFile(FTPClient ftpclient,String filename,String realMoveToFolder,
		LogWriter log, Job parentJob,Result result) throws Exception
{
	String localFilename=filename;
	targetFilename = getTargetFilename(localFilename);
	
       if ((!onlyGettingNewFiles) ||
       	(onlyGettingNewFiles && needsDownload(targetFilename)))
       {
       	if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryFTP.GettingFile",filename, environmentSubstitute(targetDirectory)));  //$NON-NLS-1$
		ftpclient.get(targetFilename, filename);
				
		// Update retrieved files
		updateRetrievedFiles();
           if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryFTP.GotFile", filename)); //$NON-NLS-1$
		
           // Add filename to result filenames
           addFilenameToResultFilenames(log, result, parentJob, targetFilename);

		// Delete the file if this is needed!
		if (remove) {
			ftpclient.delete(filename);
			if(log.isDetailed()) 
	            if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryFTP.DeletedFile", filename)); //$NON-NLS-1$
		}else
		{
			if(movefiles){
				// Try to move file to destination folder ...
				ftpclient.rename(filename, realMoveToFolder+FILE_SEPARATOR+filename);
				
				if(log.isDetailed()) 
					log.logDetailed(toString(), Messages.getString("JobEntryFTP.MovedFile",filename,realMoveToFolder));
			}
		}
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:37,代码来源:JobEntryFTP.java

示例6: displayResults

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void displayResults(LogWriter log)
{
	if(log.isDetailed()){
		log.logDetailed(toString(), "=======================================");
		log.logDetailed(toString(), Messages.getString("JobEntryFTP.Log.Info.FilesInError","" + NrErrors));
		log.logDetailed(toString(), Messages.getString("JobEntryFTP.Log.Info.FilesRetrieved","" + NrfilesRetrieved));
		log.logDetailed(toString(), "=======================================");
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:JobEntryFTP.java

示例7: createParentFolder

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean createParentFolder(String filename)
{
	// Check for parent folder
	FileObject parentfolder=null;
	
	boolean result=false;
	LogWriter log = LogWriter.getInstance();
	try
	{
		// Get parent folder
		parentfolder=KettleVFS.getFileObject(filename).getParent();	
		
   		if(!parentfolder.exists())	
   		{
   			if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.CanNotFindFolder",""+parentfolder.getName()));
   			parentfolder.createFolder();
   			if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.FolderCreated",""+parentfolder.getName()));
   		}
   		else
   		{
   			if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.FolderExists", ""+parentfolder.getName()));
   		}
   		result= true;
	}
	catch (Exception e) {
		log.logError(toString(),Messages.getString("JobEntryZipFile.CanNotCreateFolder",""+parentfolder.getName()));			
	}
	finally {
        	if ( parentfolder != null )
        	{
        		try  {
        			parentfolder.close();
        			parentfolder=null;
        		}
        		catch ( Exception ex ) {};
        	}
       }	
	return result;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:40,代码来源:JobEntryZipFile.java

示例8: setLog

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void setLog(LogWriter log, int loglevel, StringBuffer msg)
{
	switch (loglevel) {
	case LogWriter.LOG_LEVEL_ERROR:
		// Output message to log
		// Log level = ERREUR	
		log.logError(toString(), msg.toString());
		break;
	case LogWriter.LOG_LEVEL_MINIMAL:
		// Output message to log
		// Log level = MINIMAL	
		log.logMinimal(toString(), msg.toString());
		break;
	case LogWriter.LOG_LEVEL_BASIC:
		// Output message to log
		// Log level = BASIC	
		log.logBasic(toString(), msg.toString());
		break;
	case LogWriter.LOG_LEVEL_DETAILED:
		// Output message to log
		// Log level = DETAILED	
		log.logDetailed(toString(), msg.toString());
		break;
	case LogWriter.LOG_LEVEL_DEBUG:
		// Output message to log
		// Log level = DEBUG	
		log.logDebug(toString(), msg.toString());
		break;
	case LogWriter.LOG_LEVEL_ROWLEVEL:
		// Output message to log
		// Log level = ROW LEVEL	
		log.logRowlevel(toString(), msg.toString());
		break;
		default:
			// Output message to log
			// Log level = BASIC	
			log.logBasic(toString(), msg.toString());
			break;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:41,代码来源:WriteToLog.java

示例9: displayResults

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void displayResults(LogWriter log)
{
	if(log.isDetailed())
	{
		log.logDetailed(toString(), "=======================================");
		log.logDetailed(toString(), Messages.getString("JobXMLWellFormed.Log.Info.FilesInError","" + NrErrors));
		log.logDetailed(toString(), Messages.getString("JobXMLWellFormed.Log.Info.FilesInBadFormed","" + NrBadFormed));
		log.logDetailed(toString(), Messages.getString("JobXMLWellFormed.Log.Info.FilesInWellFormed","" + NrWellFormed));
		log.logDetailed(toString(), "=======================================");
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:12,代码来源:JobEntryXMLWellFormed.java

示例10: checkOneFile

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean checkOneFile(FileObject file, LogWriter log,Result result,Job parentJob)
{
	boolean retval=false;
	try
	{
	 // We deal with a file..so let's check if it's well formed
	 boolean retformed=CheckWellFormed(file,log);
	 if(!retformed)
	 {
		 log.logError(toString(), Messages.getString("JobXMLWellFormed.Error.FileBadFormed",file.toString()));					
		 // Update Bad formed files number
		 updateBadFormed(); 
		 if(resultfilenames.equals(ADD_ALL_FILENAMES) || resultfilenames.equals(ADD_BAD_FORMED_FILES_ONLY))
			 addFileToResultFilenames(KettleVFS.getFilename(file),log,result,parentJob);
	 }else
	 {
		 if(log.isDetailed())
		 {
			 log.logDetailed(toString(), "---------------------------");
			 log.logDetailed(toString(), Messages.getString("JobXMLWellFormed.Error.FileWellFormed",file.toString()));					
		 }
		 // Update Well formed files number
		 updateWellFormed(); 
		 if(resultfilenames.equals(ADD_ALL_FILENAMES) || resultfilenames.equals(ADD_WELL_FORMED_FILES_ONLY))
				 addFileToResultFilenames(KettleVFS.getFilename(file),log,result,parentJob);
	 }
	
	}catch (Exception e){}
	 return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:31,代码来源:JobEntryXMLWellFormed.java

示例11: CreateDestinationFolder

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean CreateDestinationFolder(String foldername,LogWriter log)
{
	FileObject folder=null;
	try
	{
		folder=KettleVFS.getFileObject(foldername);
		
   		if(!folder.exists())	
   		{
   			log.logError(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderNotExists", foldername));
   			if(isCreateDestinationFolder())
   				folder.createFolder();
   			else
   				return false;
   			if(log.isBasic()) log.logBasic(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderCreated",foldername));
   		}else
   		{
   			if(log.isDetailed())
   				log.logDetailed(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderExists",foldername));	
   		}
   		return true;
	}
	catch (Exception e) {
		log.logError(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.CanNotCreatedFolder", foldername,e.toString()));
		
	}
	 finally {
        	if ( folder != null )
        	{
        		try  {
        			folder.close();
        		}
        		catch (Exception ex ) {};
        	}
        }
	 return false;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:JobEntryCopyMoveResultFilenames.java

示例12: execute

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
	LogWriter log = LogWriter.getInstance();
	Result result = previousResult;
	result.setResult( false );
	int missingfiles=0;
	
	if (arguments != null) 
	{
	      for (int i = 0; i < arguments.length && !parentJob.isStopped(); i++) 
	      {
	    	  FileObject file =null;
	      
	    	  try
	            {
	    		   String realFilefoldername = environmentSubstitute(arguments[i]);
	    		   file = KettleVFS.getFileObject(realFilefoldername);
	    		  
	    		    if (file.exists() && file.isReadable())
	    		    {
	    		    	if(log.isDetailed())
	    		    		log.logDetailed(toString(), Messages.getString("JobEntryFilesExist.File_Exists", realFilefoldername)); //$NON-NLS-1$
	    		    }
	                else
	                {
	                	missingfiles ++;
	                	result.setNrErrors(missingfiles);
	                	if(log.isDetailed())
	                		log.logDetailed(toString(), Messages.getString("JobEntryFilesExist.File_Does_Not_Exist", realFilefoldername)); //$NON-NLS-1$
	                }
	    		  
	            }
	    	  	catch (IOException e)
	            {
	    	  		missingfiles ++;
	                result.setNrErrors(missingfiles);
	                log.logError(toString(), Messages.getString("JobEntryFilesExist.ERROR_0004_IO_Exception", e.toString())); //$NON-NLS-1$
	            }
	    	  	finally
	    	  	{
	    	  		if (file != null) {try {file.close();} catch (IOException ex) {};}
	    	  	}
	      }
	        
	}
	
	if(missingfiles==0) 
		result.setResult(true);
	
	return result;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:52,代码来源:JobEntryFilesExist.java

示例13: CreateDestinationFolder

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean CreateDestinationFolder(FileObject filefolder)
{
	LogWriter log = LogWriter.getInstance();
	FileObject folder=null;
	try
	{
		if(destination_is_a_file)
			folder=filefolder.getParent();
		else
			folder=filefolder;
		
   		if(!folder.exists())	
   		{
   			if(create_destination_folder)
   			{
       			if(log.isDetailed()) log.logDetailed("Folder", "Folder  " + folder.getName() + " does not exist !");
       			folder.createFolder();
       			if(log.isDetailed()) log.logDetailed("Folder", "Folder parent was created.");
   			}else
   			{
   				log.logError("Folder", "Folder  " + folder.getName() + " does not exist !");
   				return false;
   			}
   		}
   		return true;
	}
	catch (Exception e) {
		log.logError(toString(),"Couldn't created parent folder "+ folder.getName());
		
	}
	 finally {
        	if ( folder != null )
        	{
        		try  {
        			folder.close();
        		}
        		catch (Exception ex ) {};
        	}
        }
	 return false;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:42,代码来源:JobEntryCopyFiles.java

示例14: execute

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
	LogWriter log = LogWriter.getInstance();
	Result result = previousResult;
	result.setResult(false);
	result.setNrErrors(1);
	
	int nrexistcolums=0;
	int nrnotexistcolums=0;
	
	if(Const.isEmpty(tablename))
	{
		log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.TablenameEmpty"));
		return result;
	}
	if(arguments == null) 
	{
		log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.ColumnameEmpty"));
		return result;
	}
	if (connection!=null)
	{
		Database db = new Database(connection);

		try
		{
			String realSchemaname = environmentSubstitute(schemaname);
               String realTablename = environmentSubstitute(tablename);
               
               if(!Const.isEmpty(realSchemaname))
               	realTablename = db.getDatabaseMeta().getQuotedSchemaTableCombination(realSchemaname, realTablename);
               else
               	realTablename = db.getDatabaseMeta().quoteField(realTablename);
               
			db.connect();

			if (db.checkTableExists(realTablename))
			{
				if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryColumnsExist.Log.TableExists",realTablename));
			
				for (int i = 0; i < arguments.length && !parentJob.isStopped(); i++) 
			     {
					 String realColumnname = environmentSubstitute(arguments[i]);
					 realColumnname=db.getDatabaseMeta().quoteField(realColumnname);
					 
					 if (db.checkColumnExists(realColumnname,realTablename))
					 {
						if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryColumnsExist.Log.ColumnExists",realColumnname,realTablename));
						nrexistcolums++;
					 }else
					 {
						log.logError(toString(), Messages.getString("JobEntryColumnsExist.Log.ColumnNotExists",realColumnname,realTablename));
						nrnotexistcolums++;
					 }
			     }
			}
			else
			{
				log.logError(toString(), Messages.getString("JobEntryColumnsExist.Log.TableNotExists",realTablename));
			}	
		}
		catch(KettleDatabaseException dbe)
		{
			log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.UnexpectedError",dbe.getMessage()));
		}finally
		{
			if(db!=null) try{db.disconnect();}catch(Exception e){};
		}
	}
	else
	{
		log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.NoDbConnection"));
	}
	
	result.setEntryNr(nrnotexistcolums);
	result.setNrLinesWritten(nrexistcolums);		
	if(nrnotexistcolums==0)	result.setResult(true);
	return result;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:80,代码来源:JobEntryColumnsExist.java

示例15: execute

import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
/**
 * Execute this job entry and return the result.
 * In this case it means, just set the result boolean in the Result class.
 * @param previousResult The result of the previous execution
 * @return The Result of the execution.
 */
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
	Result result = previousResult;
	result.setNrErrors(1);
	result.setResult(false);
	LogWriter log = LogWriter.getInstance();
	
	String realEmailAddress=environmentSubstitute(emailAddress);
	if(Const.isEmpty(realEmailAddress))
	{
		log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailEmpty"));
		return result;
	}
	String realSender=environmentSubstitute(emailSender);
	if(smtpCheck)
	{
		// check sender
		if(Const.isEmpty(realSender))
		{
			log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailSenderEmpty"));
			return result;
		}
	}
	
	String realDefaultSMTP=environmentSubstitute(defaultSMTP);
	int timeOut=Const.toInt(environmentSubstitute(timeout), 0);
	
       // Split the mail-address:  separated by space
       String mailsCheck[] = realEmailAddress.split(" ");
       boolean exitloop=false;
       boolean mailIsValid=false;
       String MailError=null;
       for (int i = 0; i < mailsCheck.length && !exitloop; i++)
       {
       	String email = mailsCheck[i];
       	if(log.isDetailed())
       		log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.CheckingMail",email));
   		
       	// Check if address is valid
   		MailValidationResult resultValidator=MailValidation.isAddressValid(email,
   				realSender,	realDefaultSMTP,timeOut,smtpCheck);
   		
   		mailIsValid=resultValidator.isValide();
   		MailError=resultValidator.getErrorMessage();
   		
       	if(log.isDetailed())
       	{
       		if(mailIsValid)
       			log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailValid",email));
       		else
       		{
       			log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailNotValid",email));
       			log.logDetailed(toString(), MailError);
       		}
   		
       	}
   		// invalid mail? exit loop
   		if(!resultValidator.isValide()) exitloop=true;
       }
	
	result.setResult(mailIsValid);
	if(mailIsValid) result.setNrErrors(0);

	// return result
	
	return result;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:74,代码来源:JobEntryMailValidator.java


注:本文中的org.pentaho.di.core.logging.LogWriter.logDetailed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。