本文整理汇总了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());
}
}
示例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());
}
示例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));
}
示例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"));
}
示例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));
}
示例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);
}
示例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);
}
示例8: testLoggerInitLogFilePathIsNull
import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsNull() {
Logger.init("debug", null, "newrelic.log", 1024);
}
示例9: testLoggerInitLogFilePathIsEmptyString
import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsEmptyString() {
Logger.init("debug", "", "newrelic.log", 1024);
}
示例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);
}
示例11: testLoggerInitLogFileNameIsEmptyString
import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFileNameIsEmptyString() {
Logger.init("debug", "/var/log/newrelic", "", 1024);
}
示例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);
}
示例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);
}
示例14: testTranslateLevelThrowsIllegalArgumentExceptionOnNull
import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testTranslateLevelThrowsIllegalArgumentExceptionOnNull() {
Logger.translateLevel(null);
}
示例15: testBuildMessageThrowsIllegalArgumentExceptionOnNull
import com.newrelic.metrics.publish.util.Logger; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testBuildMessageThrowsIllegalArgumentExceptionOnNull() {
Logger.buildMessage(null);
}