本文整理汇总了Java中org.pentaho.di.core.logging.LogWriter.setConsoleAppenderDebug方法的典型用法代码示例。如果您正苦于以下问题:Java LogWriter.setConsoleAppenderDebug方法的具体用法?Java LogWriter.setConsoleAppenderDebug怎么用?Java LogWriter.setConsoleAppenderDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.logging.LogWriter
的用法示例。
在下文中一共展示了LogWriter.setConsoleAppenderDebug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 : "
}
}
示例2: init
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
/**
* 初始化Ketle环境。此方法执行以下 操作:
*
* 创建一个Kettle "home" 的目录,如果它已经不存在 - 读取 在kettle.properties文件 - 初始化记录后端 - 设置
* 控制台日志级别调试 - 如果指定的参数,配置 简单的JNDI - 寄存器的各种原生类型和插件 插件类型 - 读取变量列表 - 初始化生命周期
* 启动监听程序等
*
* @param simpleJndi
* , 真正简单的JNDI配置,否则返回false
* @throws KettleException
* 在初始化过程中发生的任何错误都将抛出 KettleException。
*/
public static void init(boolean simpleJndi) throws KettleException {
if (initialized == null) {
// 创建一个Kettle "home" 的目录
// createKettleHome();
// 初始化 kettle.properties 初始化其他属性等
environmentInit();
// 初始化日志
CentralLogStore.init();
// 设置控制台日志级用来调试
LogWriter.setConsoleAppenderDebug();
// 配置简单的JNDI 仅供我们在单机模式运行
if (simpleJndi) {
JndiUtil.initJNDI();
}
// 注册原生类型和各个所需的插件
PluginRegistry.addPluginType(StepPluginType.getInstance());
PluginRegistry.addPluginType(PartitionerPluginType.getInstance());
PluginRegistry.addPluginType(JobEntryPluginType.getInstance());
PluginRegistry.addPluginType(RepositoryPluginType.getInstance());
PluginRegistry.addPluginType(DatabasePluginType.getInstance());
PluginRegistry.addPluginType(LifecyclePluginType.getInstance());
PluginRegistry.addPluginType(KettleLifecyclePluginType
.getInstance());
PluginRegistry.addPluginType(ImportRulePluginType.getInstance());
PluginRegistry.init();
// 初始化读取的变量列表。
KettleVariablesList.init();
// 初始化生命周期监听器
initLifecycleListeners();
initialized = true;
}
}
示例3: getCommandLineArgs
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public static CommandLineOption[] getCommandLineArgs(List<String> args) {
CommandLineOption[] clOptions = new CommandLineOption[] { new CommandLineOption("rep", "Repository name", new StringBuffer()), new CommandLineOption("user", "Repository username", new StringBuffer()),
new CommandLineOption("pass", "Repository password", new StringBuffer()), new CommandLineOption("job", "The name of the job to launch", new StringBuffer()),
new CommandLineOption("trans", "The name of the transformation to launch", new StringBuffer()), new CommandLineOption("dir", "The directory (don't forget the leading /)", new StringBuffer()),
new CommandLineOption("file", "The filename (Transformation in XML) to launch", new StringBuffer()), new CommandLineOption("level", "The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)", new StringBuffer()),
new CommandLineOption("logfile", "The logging file to write to", new StringBuffer()), new CommandLineOption("log", "The logging file to write to (deprecated)", new StringBuffer(), false, true), };
LogWriter log;
LogWriter.setConsoleAppenderDebug();
// start with the default logger until we find out otherwise
log = LogWriter.getInstance(LogWriter.LOG_LEVEL_BASIC);
// Parse the options...
if (!CommandLineOption.parseArguments(args, clOptions, log)) {
log.logError("Spoon", "Command line option not understood");
System.exit(8);
}
String kettleRepname = Const.getEnvironmentVariable("KETTLE_REPOSITORY", null);
String kettleUsername = Const.getEnvironmentVariable("KETTLE_USER", null);
String kettlePassword = Const.getEnvironmentVariable("KETTLE_PASSWORD", null);
if (!Const.isEmpty(kettleRepname))
clOptions[0].setArgument(new StringBuffer(kettleRepname));
if (!Const.isEmpty(kettleUsername))
clOptions[1].setArgument(new StringBuffer(kettleUsername));
if (!Const.isEmpty(kettlePassword))
clOptions[2].setArgument(new StringBuffer(kettlePassword));
return clOptions;
}
示例4: init
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public static void init(boolean simpleJndi) throws KettleException {
if (initialized==null) {
// Create a home for Kettle if it doesn't exist yet.
//
createKettleHome();
// Read the kettle.properties file before anything else
//
EnvUtil.environmentInit();
// Initialize the logging back-end.
//
CentralLogStore.init();
// Set the console log level to debug
//
LogWriter.setConsoleAppenderDebug();
// Configure Simple JNDI when we run in stand-alone mode (spoon, pan, kitchen, carte, ... NOT on the platform
//
if (simpleJndi) {
JndiUtil.initJNDI();
}
// Register the native types and the plugins for the various plugin types...
//
PluginRegistry.addPluginType(StepPluginType.getInstance());
PluginRegistry.addPluginType(PartitionerPluginType.getInstance());
PluginRegistry.addPluginType(JobEntryPluginType.getInstance());
PluginRegistry.addPluginType(RepositoryPluginType.getInstance());
PluginRegistry.addPluginType(DatabasePluginType.getInstance());
PluginRegistry.addPluginType(LifecyclePluginType.getInstance());
PluginRegistry.addPluginType(ImportRulePluginType.getInstance());
PluginRegistry.init();
// Also read the list of variables.
//
KettleVariablesList.init();
initialized = true;
}
}