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


Java Logger类代码示例

本文整理汇总了Java中com.newrelic.metrics.publish.util.Logger的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Runner

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
/**
 * Constructs a {@code Runner}
 * @throws ConfigurationException if there is a configuration issue
 */
public Runner() throws ConfigurationException {
    super();
    componentAgents = new LinkedList<Agent>();

    try {
        Config.init();
        Logger.init(Config.getValue("log_level", "info"),
                    Config.getValue("log_file_path", "logs"),
                    Config.getValue("log_file_name", "newrelic_plugin.log"),
                    getLogLimitInKilobytes());
        logger = Logger.getLogger(Runner.class);
        config = new SDKConfiguration();
    } catch (Exception e) {
        throw new ConfigurationException(e.getMessage());
    }
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:21,代码来源:Runner.java

示例2: testLoggerInit

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test
public void testLoggerInit() {
    Logger.init("debug", "/var/log/newrelic", "newrelic.log", 1024);
    
    assertEquals(Level.Debug, Logger.getLevel());
    assertEquals("/var/log/newrelic", Logger.getFilePath());
    assertEquals("newrelic.log", Logger.getFileName());
    assertEquals(1024, Logger.getFileLimitInKBytes().intValue());
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:10,代码来源:LoggerTest.java

示例3: testTranslateLevel

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test
public void testTranslateLevel() {
    assertEquals(ch.qos.logback.classic.Level.DEBUG, Logger.translateLevel(Level.Debug));
    assertEquals(ch.qos.logback.classic.Level.INFO,  Logger.translateLevel(Level.Info));
    assertEquals(ch.qos.logback.classic.Level.WARN,  Logger.translateLevel(Level.Warn));
    assertEquals(ch.qos.logback.classic.Level.ERROR, Logger.translateLevel(Level.Error));
    assertEquals(ch.qos.logback.classic.Level.ERROR, Logger.translateLevel(Level.Fatal));
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:9,代码来源:LoggerTest.java

示例4: testBuildMessage

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test
public void testBuildMessage() {
    assertEquals("", Logger.buildMessage(""));
    assertEquals("test message", Logger.buildMessage("test message"));
    assertEquals("test message", Logger.buildMessage("test ", "message"));
    assertEquals("test message\t", Logger.buildMessage("test ", "message", "\t"));
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:8,代码来源:LoggerTest.java

示例5: testBuildMessageCallsToStringOnObjects

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test
public void testBuildMessageCallsToStringOnObjects() {
    Object testObject = new Object() {
        public String toString() {
            return "test message";
        }
    };
    assertEquals("test message", Logger.buildMessage(testObject));
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:10,代码来源:LoggerTest.java

示例6: testLoggerInitLevelIsNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLevelIsNull() {
    Logger.init(null, "/var/log/newrelic", "newrelic.log", 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例7: testLoggerInitLevelIsEmptyString

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLevelIsEmptyString() {
    Logger.init("", "/var/log/newrelic", "newrelic.log", 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例8: testLoggerInitLogFilePathIsNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsNull() {
    Logger.init("debug", null, "newrelic.log", 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例9: testLoggerInitLogFilePathIsEmptyString

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsEmptyString() {
    Logger.init("debug", "", "newrelic.log", 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例10: testLoggerInitLogFileNameIsNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFileNameIsNull() {
    Logger.init("debug", "/var/log/newrelic", null, 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例11: testLoggerInitLogFileNameIsEmptyString

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFileNameIsEmptyString() {
    Logger.init("debug", "/var/log/newrelic", "", 1024);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例12: testLoggerInitLogLimitInKBytesIsNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogLimitInKBytesIsNull() {
    Logger.init("debug", "/var/log/newrelic", "newrelic.log", null);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例13: testLoggerInitLogLimitInKBytesIsNegative

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogLimitInKBytesIsNegative() {
    Logger.init("debug", "/var/log/newrelic", "newrelic.log", -1);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例14: testTranslateLevelThrowsIllegalArgumentExceptionOnNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testTranslateLevelThrowsIllegalArgumentExceptionOnNull() {
    Logger.translateLevel(null);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java

示例15: testBuildMessageThrowsIllegalArgumentExceptionOnNull

import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testBuildMessageThrowsIllegalArgumentExceptionOnNull() {
    Logger.buildMessage(null);
}
 
开发者ID:RicardoJTSantos,项目名称:ScriptAgentNewRelicPlugin,代码行数:5,代码来源:LoggerTest.java


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