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


Java LogConfigurator.setRootLevel方法代码示例

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


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

示例1: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure(boolean FreezeLogging) {
    final LogConfigurator logConfigurator = new LogConfigurator();
    logConfigurator.setFilePattern(LOG_LINE_PATTERN);
    logConfigurator.setFileName(LOG_FILENAME);
    logConfigurator.setRootLevel(FreezeLogging ? Level.OFF : LOG_LEVEL);
    logConfigurator.setMaxFileSize(FILE_SIZE);
    logConfigurator.setMaxBackupSize(MAX_BACKUP_SIZE);
    // Set log level of a specific logger
    logConfigurator.setLevel("org.apache", Level.ERROR);
    logConfigurator.setResetConfiguration(FreezeLogging);
    try {
        logConfigurator.configure();
    } catch (Exception e){
        //log configuration not supported by device
    }
}
 
开发者ID:casific,项目名称:murmur,代码行数:17,代码来源:ConfigureLog4J.java

示例2: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure() {
    final LogConfigurator logConfigurator = new LogConfigurator();
    logConfigurator.setUseFileAppender(false);
    logConfigurator.setRootLevel(Level.DEBUG);
    logConfigurator.setLevel("org.apache", Level.ERROR);
    logConfigurator.configure();
}
 
开发者ID:Microsoft,项目名称:healthvault-java-sdk,代码行数:8,代码来源:ConfigureLog4J.java

示例3: getMyLogger

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static Logger getMyLogger(String className) {
    if (MyAccountUtil.isSDCardMounted()) {
        System.out.println("SD card has already mounted");
        logDir = Environment.getExternalStorageDirectory() + File.separator + "myaccount" + File.separator + "logs";
    } else {
        System.out.println("SD card hasn't already mounted");
        logDir = MainActivity.getBaseDir() + File.separator + "myaccount" + File.separator + "logs";
    }
    File destDir = new File(logDir);
    if (!destDir.exists()) {
        Boolean isSuccess = destDir.mkdirs();
        if (!isSuccess)
            System.out.println("create dir " + destDir + " failed.");
    }


    if (myLogger == null) {
        final LogConfigurator logConfigurator = new LogConfigurator();
        logConfigurator.setFileName(logDir + File.separator + "myaccount.log");
        // Set the root log level
        logConfigurator.setRootLevel(Level.DEBUG);
        // Set log level of a specific logger
        logConfigurator.setLevel("org.apache", Level.ERROR);
        logConfigurator.configure();

        //gLogger = Logger.getLogger(this.getClass());
        myLogger = Logger.getLogger(className != null ? className : MainActivity.class.getName());

    }
    return myLogger;
}
 
开发者ID:shenyanf,项目名称:AccountBook,代码行数:32,代码来源:MyLogger.java

示例4: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
/**
 * Configures log4j to use an Android appender.
 * 
 * @param context
 *        - the context of the application or service
 */
public static void configure(Context context) {
    final LogConfigurator logConfigurator = new LogConfigurator();

    String logfilePath = context.getFilesDir() + LOG_FILE;
    logConfigurator.setFileName(logfilePath);
    logConfigurator.setRootLevel(Level.DEBUG);
    // Set log level of a specific logger
    logConfigurator.setLevel(LOGGER_NAME, Level.ERROR);
    logConfigurator.configure();
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:17,代码来源:Log4JConfigurator.java

示例5: configLog

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public void configLog() {
	final LogConfigurator logConfigurator = new LogConfigurator();

	logConfigurator.setFileName(Environment.getExternalStorageDirectory() + File.separator + "Cookbook_Log4j.log");
	// Set the root log level
	logConfigurator.setRootLevel(Level.DEBUG);
	// Set log level of a specific logger
	logConfigurator.setLevel(TAG, Level.ERROR);
	logConfigurator.configure();

	mLogger = (Logger) Logger.getInstance(Log4jActivity.class);
}
 
开发者ID:AskViky,项目名称:CommunityService,代码行数:13,代码来源:Log4jActivity.java

示例6: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
/**
 * Configures log4j to use an Android appender.
 */
public static void configure() {
    final LogConfigurator logConfigurator = new LogConfigurator();

    logConfigurator.setFileName(LOG_FILE_PATH);
    logConfigurator.setRootLevel(Level.DEBUG);
    // Set log level of a specific logger
    logConfigurator.setLevel(LOGGER_NAME, Level.ERROR);
    logConfigurator.configure();
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-uiautomator-bridge,代码行数:13,代码来源:Log4JConfigurator.java

示例7: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure() {
    final LogConfigurator logConfigurator = new LogConfigurator();
            
    logConfigurator.setFileName(Preferences.NW_STATS_FILE);
    logConfigurator.setRootLevel(Level.DEBUG);
    // Set log level of a specific logger
    logConfigurator.setLevel("org.apache", Level.ERROR);
    logConfigurator.configure();
}
 
开发者ID:SimbaService,项目名称:Simba,代码行数:10,代码来源:ConfigLog4j.java

示例8: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure() {
        final LogConfigurator logConfigurator = new LogConfigurator();
//        Date nowtime = new Date();
//        String needWriteMessage = myLogSdf.format(nowtime);
        //日志文件路径地址:SD卡下myc文件夹log文件夹的test文件
        String fileName = Environment.getExternalStorageDirectory()
                + File.separator + "SmartCamera" + File.separator + "log"
                + File.separator + "Server.log";
        //设置文件名
        logConfigurator.setFileName(fileName);
        //设置root日志输出级别 默认为DEBUG
        logConfigurator.setRootLevel(Level.DEBUG);
        // 设置日志输出级别
        logConfigurator.setLevel("org.apache", Level.INFO);
        //设置 输出到日志文件的文字格式 默认 %d %-5p [%c{2}]-[%L] %m%n
        logConfigurator.setFilePattern("%d %-5p [%c{2}]-[%L] %m%n");
        //设置输出到控制台的文字格式 默认%m%n
        logConfigurator.setLogCatPattern("%m%n");
        //设置总文件大小
//        logConfigurator.setMaxFileSize(1024 * 1024 * 5);
//        //设置最大产生的文件个数
//        logConfigurator.setMaxBackupSize(100);

        //设置所有消息是否被立刻输出 默认为true,false 不输出
        logConfigurator.setImmediateFlush(true);
        //是否本地控制台打印输出 默认为true ,false不输出
        logConfigurator.setUseLogCatAppender(true);
        //设置是否启用文件附加,默认为true。false为覆盖文件
        logConfigurator.setUseFileAppender(true);
        //设置是否重置配置文件,默认为true
        logConfigurator.setResetConfiguration(true);
        //是否显示内部初始化日志,默认为false
        logConfigurator.setInternalDebugging(false);

        logConfigurator.configure();

    }
 
开发者ID:384401056,项目名称:itheima,代码行数:38,代码来源:MyApplication.java

示例9: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure() {
  final LogConfigurator logConfigurator = new LogConfigurator();
  logConfigurator
      .setFileName(Environment.getExternalStorageDirectory() + File.separator + "SdsBasicDemo.log");
  logConfigurator.setRootLevel(Level.INFO);
  logConfigurator.configure();
}
 
开发者ID:XiaoMi,项目名称:galaxy-sdk-java,代码行数:8,代码来源:SdsBasicDemo.java

示例10: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
public static void configure(Context context) {
    final LogConfigurator logConfigurator = new LogConfigurator();
    logConfigurator
            .setLogCatPattern("%d{yyyy-MM-dd HH:mm:ss.SSS} %p:%r:%c:%m%n");
    logConfigurator.setRootLevel(Level.DEBUG);

    // logConfigurator.setUseFileAppender(false);
    // logConfigurator.setUseLogCatAppender(false);
    File logFileDir = context.getExternalFilesDir(null);
    String logFilePath = new File(logFileDir, "myapp.log")
            .getAbsolutePath();
    logConfigurator.setFileName(logFilePath);

    logConfigurator.configure();
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:16,代码来源:ConfigureLog4j.java

示例11: configure

import de.mindpipe.android.logging.log4j.LogConfigurator; //导入方法依赖的package包/类
private static void configure() {
	LogConfigurator conf = new LogConfigurator();

	conf.setFileName(Environment.getExternalStorageDirectory()
			+ File.separator + "lifx-tasker.log");
	conf.setRootLevel(Level.DEBUG);

	conf.setUseFileAppender(true);
	conf.setUseLogCatAppender(false);

	conf.configure();

}
 
开发者ID:timothyb89,项目名称:lifx-tasker,代码行数:14,代码来源:Logging.java


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