本文整理汇总了Java中org.pentaho.di.core.logging.LogWriter类的典型用法代码示例。如果您正苦于以下问题:Java LogWriter类的具体用法?Java LogWriter怎么用?Java LogWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LogWriter类属于org.pentaho.di.core.logging包,在下文中一共展示了LogWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
示例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;
}
示例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);
}
}
示例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;
}
示例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));
}
}
示例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 : "
}
}
示例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 + '!';
}
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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+"]");
}
}