• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java LogWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



LogWriter类属于org.pentaho.di.core.logging包,在下文中一共展示了LogWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: TransDialog

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public TransDialog(Shell parent, int style, TransMeta transMeta, Repository rep)
{
    super(parent, style);
    this.log      = LogWriter.getInstance();
    this.props    = PropsUI.getInstance();
    this.transMeta    = transMeta;
    this.rep      = rep;
    
    this.newDirectory = null;
    
    schemas = new ArrayList<PartitionSchema>();
    for (int i=0;i<transMeta.getPartitionSchemas().size();i++)
    {
        schemas.add( (PartitionSchema) transMeta.getPartitionSchemas().get(i).clone() );
    }
    previousSchemaIndex = -1;
    
    directoryChangeAllowed=true;
    changed=false;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:TransDialog.java


示例2: addOkRemark

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public static void addOkRemark(CheckResultSourceInterface source, String propertyName,
    List<CheckResultInterface> remarks)
{
  final int SUBSTRING_LENGTH = 20;
  LogWriter log = LogWriter.getInstance();
  log.logBasic(JobEntryValidatorUtils.class.getSimpleName(), "attempting to fetch property named '" + propertyName
      + "'");
  String value = ValidatorUtils.getValueAsString(source, propertyName);
  log.logBasic(JobEntryValidatorUtils.class.getSimpleName(), "fetched value [" + value + "]");
  String substr = null;
  if (value != null)
  {
    substr = value.substring(0, Math.min(SUBSTRING_LENGTH, value.length()));
    if (value.length() > SUBSTRING_LENGTH)
    {
      substr += "..."; //$NON-NLS-1$
    }
  }
  remarks.add(new CheckResult(CheckResultInterface.TYPE_RESULT_OK, ValidatorMessages.getString("messages.passed", //$NON-NLS-1$
      propertyName, substr), source));
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:JobEntryValidatorUtils.java


示例3: getTableFields

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public RowMetaInterface getTableFields()
{
	LogWriter log = LogWriter.getInstance();
       RowMetaInterface fields = null;
	if (databaseMeta!=null)
	{
		Database db = new Database(databaseMeta);
           databases = new Database[] { db }; // Keep track of this one for cancelQuery

		try
		{
			db.connect();
               String schemaTable = databaseMeta.getQuotedSchemaTableCombination(schemaName, tablename);
               fields = db.getTableFields(schemaTable);
		}
		catch(KettleDatabaseException dbe)
		{
			log.logError(toString(), Messages.getString("DatabaseLookupMeta.ERROR0004.ErrorGettingTableFields")+dbe.getMessage()); //$NON-NLS-1$
		}
		finally
		{
			db.disconnect();
		}
	}
	return fields;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:DatabaseLookupMeta.java


示例4: findString

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
protected String findString(String packageName, Locale locale, String key, Object[] parameters) throws MissingResourceException
{
    try
    {
        ResourceBundle bundle = getBundle(locale, packageName + "." + BUNDLE_NAME);
        String unformattedString = bundle.getString(key);
        String string = MessageFormat.format(unformattedString, parameters);
        return string;
    }
    catch(IllegalArgumentException e)
    {
        String message = "Format problem with key=["+key+"], locale=["+locale+"], package="+packageName+" : "+e.toString();
        LogWriter.getInstance().logError("i18n", message);
        LogWriter.getInstance().logError("i18n", Const.getStackTracker(e));
        throw new MissingResourceException(message, packageName, key);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:GlobalMessages.java


示例5: init

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public void init(LogWriter lw, String name, String file, String args[])
{
	this.log=lw;
	
       if (name!=null) setName(name+" ("+super.getName()+")");
       
	jobMeta = new JobMeta(log);
	jobMeta.setName(name);
	jobMeta.setFilename(file);
	jobMeta.setArguments(args);
	active=false;
	stopped=false;
       jobTracker = new JobTracker(jobMeta);
       initialized=false;
       batchId = -1;
       passedBatchId = -1;
       
       result = null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:Job.java


示例6: main

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public static void main(String[] args)
{
    Display display = new Display();
    LogWriter log = LogWriter.getInstance();
    PropsUI.init(display, Props.TYPE_PROPERTIES_SPOON);
    
    Translator translator = new Translator(display);
    translator.open();
    
    try
    {
        while (!display.isDisposed ()) 
        {
            if (!display.readAndDispatch()) display.sleep ();
        }
    }
    catch(Throwable e)
    {
        log.logError(APP_NAME, "An unexpected error occurred : "+e.getMessage());
        log.logError(APP_NAME, Const.getStackTracker(e));
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:Translator.java


示例7: initLogging

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
private static void initLogging(CommandLineOption[] options) throws KettleException {
  StringBuffer optionLogfile = getCommandLineOption(options, "logfile").getArgument();
  StringBuffer optionLoglevel = getCommandLineOption(options, "level").getArgument();

  // Set default Locale:
  Locale.setDefault(Const.DEFAULT_LOCALE);

  Log4jFileAppender fileAppender;
  if (Const.isEmpty(optionLogfile)) {
    fileAppender = LogWriter.createFileAppender(Const.SPOON_LOG_FILE, false);
  } else {
    fileAppender = LogWriter.createFileAppender(optionLogfile.toString(), true);
  }
  LogWriter.getInstance().addAppender(fileAppender);

  if (log.isBasic()) {
    log.logBasic(BaseMessages.getString(PKG, "Spoon.Log.LoggingToFile") + fileAppender.getFile().toString());// "Logging goes to "
  }

  if (!Const.isEmpty(optionLoglevel)) {
    log.setLogLevel(LogLevel.getLogLevelForCode(optionLoglevel.toString()));
    if (log.isBasic())
      log.logBasic(BaseMessages.getString(PKG, "Spoon.Log.LoggingAtLevel") + log.getLogLevel().getDescription());// "Logging is at level : "
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:26,代码来源:Spoon.java


示例8: getSystemString

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
/**
 * @deprecated  As of build 4512, replaced by {@link #getInstance() and #getString(String, String, String, String)}
 */
@Deprecated
public static String getSystemString(String key, String param1, String param2, String param3)
{
    try
    {
        return GlobalMessageUtil.getString(getBundle(langChoice.getFailoverLocale(), buildBundleName(SYSTEM_BUNDLE_PACKAGE)), key, param1, param2, param3);
    }
    catch (MissingResourceException e)
    {
        try
        {
            return GlobalMessageUtil.getString(getBundle(langChoice.getFailoverLocale(), buildBundleName(SYSTEM_BUNDLE_PACKAGE)), key, param1, param2, param3);
        }
        catch (MissingResourceException fe)
        {
            LogWriter.getInstance().logError("Internationalisation/Translation error", Const.getStackTracker(e));
            return '!' + key + '!';
        }
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:24,代码来源:GlobalMessages.java


示例9: loadXML

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep)
	throws KettleXMLException
{
	try
	{
		super.loadXML(entrynode, databases, slaveServers);
		logmessage = XMLHandler.getTagValue(entrynode, "logmessage");
		loglevel = LogWriter.getLogLevel( XMLHandler.getTagValue(entrynode, "loglevel"));
		logsubject = XMLHandler.getTagValue(entrynode, "logsubject");
	}
	catch(Exception e)
	{
		throw new KettleXMLException(Messages.getString("WriteToLog.Error.UnableToLoadFromXML.Label"), e);
		
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:JobEntryWriteToLog.java


示例10: loadRep

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public void loadRep(Repository rep, long id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers)
	throws KettleException
{
	try
	{
		super.loadRep(rep, id_jobentry, databases, slaveServers);

		logmessage = rep.getJobEntryAttributeString(id_jobentry, "logmessage");
		loglevel = LogWriter.getLogLevel( rep.getJobEntryAttributeString(id_jobentry, "loglevel") );
		logsubject = rep.getJobEntryAttributeString(id_jobentry, "logsubject");
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException(Messages.getString("WriteToLog.Error.UnableToLoadFromRepository.Label")+id_jobentry, dbe);
		
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:JobEntryWriteToLog.java


示例11: getData

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public void getData()
{
    wExecLocal.setSelection(configuration.isExecutingLocally());
    wExecRemote.setSelection(configuration.isExecutingRemotely());
    wSafeMode.setSelection(configuration.isSafeModeEnabled());
    wClearLog.setSelection(configuration.isClearingLog());
    wRemoteHost.setText( configuration.getRemoteServer()==null ? "" : configuration.getRemoteServer().toString() );
    wPassExport.setSelection(configuration.isPassingExport());
    int logIndex = wLogLevel.indexOf(LogWriter.getInstance().getLogLevelLongDesc());
    if (logIndex>=0) wLogLevel.select( logIndex );
    else wLogLevel.setText(LogWriter.getInstance().getLogLevelLongDesc());
    if (configuration.getReplayDate()!=null) wReplayDate.setText(simpleDateFormat.format(configuration.getReplayDate()));

    getParamsData();
    getArgumentsData();
    getVariablesData();
    
    enableFields();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:JobExecutionConfigurationDialog.java


示例12: TransExecutionConfiguration

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public TransExecutionConfiguration()
{
	executingLocally = true;
	
    clusterPosting = true;
    clusterPreparing = true;
    clusterStarting = true;
    clusterShowingTransformation = false;
    
    passingExport = false;
    
    arguments = new HashMap<String, String>();
    params = new HashMap<String, String>();
    variables = new HashMap<String, String>();
    
    transDebugMeta = null;
    
    logLevel = LogWriter.LOG_LEVEL_BASIC;
    
    clearingLog = true;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:TransExecutionConfiguration.java


示例13: 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


示例14: classicPing

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
private boolean classicPing(String hostname, int nrpackets,LogWriter log)
{
	boolean retval=false;
	  try
         {
             String lignePing = "";
             String CmdPing="ping " ;
             if(Const.isWindows())
           	  CmdPing+= hostname + " " + Windows_CHAR + " " + nrpackets;
             else
           	  CmdPing+= hostname + " " + NIX_CHAR + " " + nrpackets;
             
       	  if(log.isDetailed()) 
       	  {
       		  log.logDetailed(toString(), Messages.getString("JobPing.NbrPackets.Label", ""+nrpackets));
       		  log.logDetailed(toString(), Messages.getString("JobPing.ExecClassicPing.Label", CmdPing));
       	  }
       	  Process processPing = Runtime.getRuntime().exec(CmdPing);
       	  if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobPing.Gettingresponse.Label",hostname));
       	  // Get ping response
             BufferedReader br = new BufferedReader(new InputStreamReader(processPing.getInputStream()));

             // Read response lines
             while ((lignePing = br.readLine()) != null)
             {
                 if(log.isDetailed()) log.logDetailed(toString(), lignePing);
             }
             // We succeed only when 0% lost of data
             if (processPing.exitValue()==0)
             {
                 retval=true;
             }
         }

         catch (IOException ex)
         {
             log.logError(toString(), Messages.getString("JobPing.Error.Label") + ex.getMessage());
         }
         return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:41,代码来源:JobEntryPing.java


示例15: 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


示例16: get

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public String get(String key, String ... params) {
  String res = null;
  String notFoundKey = "!" + key + "!";
  
  for (String pName : packageNames) {
    // Kettle will generate an exception message if there is a
    // failed message search. Since we are searching over multiple
    // packages, we don't want this message generated unless we
    // cannot find the message in any of the packages.
    int logLevel = LogWriter.getInstance().getLogLevel();
    LogWriter.getInstance().setLogLevel(0);
    try {
      res = BaseMessages.getString(pName, key);
    }
    finally {
      LogWriter.getInstance().setLogLevel(logLevel);
    }
    if (!res.equals(notFoundKey)) {
      return res;
    }
  }
  
  // This means we did not find the key, so let Kettle generate
  // its normal error.
  return BaseMessages.getString(packageNames.get(0), key);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:AbstractMessages.java


示例17: nativeToJava

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public Object nativeToJava(TransferData transferData)
{
    if (isSupportedType(transferData))
    {
        try
        {
            byte[] buffer = (byte[]) super.nativeToJava(transferData);
            String xml = new String(Base64.decodeBase64(new String(buffer).getBytes()));
            return new DragAndDropContainer(xml);
        }
        catch (Exception e)
        {
            LogWriter.getInstance().logError(toString(),
                    "Unexpected error trying to read a drag and drop container from the XML Transfer type: " + e.toString());
            LogWriter.getInstance().logError(toString(), Const.getStackTracker(e));
            return null;
        }
    }
    return null;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:XMLTransfer.java


示例18: initLogging

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
private static void initLogging(CommandLineOption[] options) throws KettleException {
	StringBuffer optionLogfile = getCommandLineOption(options, "logfile").getArgument();
	StringBuffer optionLoglevel = getCommandLineOption(options, "level").getArgument();

	// Set default Locale:
	Locale.setDefault(Const.DEFAULT_LOCALE);

	LogWriter.setConsoleAppenderDebug();
	LogWriter log;
	if (Const.isEmpty(optionLogfile)) {
		log = LogWriter.getInstance(Const.SPOON_LOG_FILE, false, LogWriter.LOG_LEVEL_BASIC);
	} else {
		log = LogWriter.getInstance(optionLogfile.toString(), true, LogWriter.LOG_LEVEL_BASIC);
	}

	if (log.getRealFilename() != null) {
		if (log.isBasic())
			log.logBasic(APP_NAME, Messages.getString("Spoon.Log.LoggingToFile") + log.getRealFilename());// "Logging goes to "
	}

	if (!Const.isEmpty(optionLoglevel)) {
		log.setLogLevel(optionLoglevel.toString());
		if (log.isBasic())
			log.logBasic(APP_NAME, Messages.getString("Spoon.Log.LoggingAtLevel") + log.getLogLevelDesc());// "Logging is at level : "
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:Spoon.java


示例19: evaluate

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public boolean evaluate(Result result) {
  LogWriter log = LogWriter.getInstance();
  String Returnmessage = null;
  String RealMessageabort = environmentSubstitute(getMessageabort());

  try {
    // Return False
    if (RealMessageabort == null) {
      Returnmessage = Messages.getString("JobEntryAbort.Meta.CheckResult.Label"); //$NON-NLS-1$
    } else {
      Returnmessage = RealMessageabort;

    }
    log.logError(toString(), Returnmessage);
    result.setNrErrors(1);
    return false;
  } catch (Exception e) {
    result.setNrErrors(1);
    log.logError(toString(), Messages.getString("JobEntryAbort.Meta.CheckResult.CouldNotExecute") + e.toString()); //$NON-NLS-1$
    return false;
  }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:JobEntryAbort.java


示例20: RepositoriesDialog

import org.pentaho.di.core.logging.LogWriter; //导入依赖的package包/类
public RepositoriesDialog(Display disp, int perm[], String toolName)
{
    display = disp;
    toolsPermissions = perm;
    steploader = StepLoader.getInstance();
    this.toolName = toolName;

    shell = new Shell(disp, SWT.DIALOG_TRIM | SWT.MAX | SWT.MIN | SWT.RESIZE);
    shell.setText(Messages.getString("RepositoriesDialog.Dialog.Main.Title"));

    log = LogWriter.getInstance();
    props = PropsUI.getInstance();
    input = new RepositoriesMeta(log);
    repinfo = null;
    userinfo = null;
    cancelled = false;

    input.readData();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:RepositoriesDialog.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Statistic类代码示例发布时间:2022-05-22
下一篇:
Java DefaultModule类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap