本文整理汇总了Java中com.newrelic.metrics.publish.util.Logger.init方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.init方法的具体用法?Java Logger.init怎么用?Java Logger.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.newrelic.metrics.publish.util.Logger
的用法示例。
在下文中一共展示了Logger.init方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例4: testLoggerInitLevelIsEmptyString
import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLevelIsEmptyString() {
Logger.init("", "/var/log/newrelic", "newrelic.log", 1024);
}
示例5: testLoggerInitLogFilePathIsNull
import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsNull() {
Logger.init("debug", null, "newrelic.log", 1024);
}
示例6: testLoggerInitLogFilePathIsEmptyString
import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFilePathIsEmptyString() {
Logger.init("debug", "", "newrelic.log", 1024);
}
示例7: testLoggerInitLogFileNameIsNull
import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFileNameIsNull() {
Logger.init("debug", "/var/log/newrelic", null, 1024);
}
示例8: testLoggerInitLogFileNameIsEmptyString
import com.newrelic.metrics.publish.util.Logger; //导入方法依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testLoggerInitLogFileNameIsEmptyString() {
Logger.init("debug", "/var/log/newrelic", "", 1024);
}
示例9: 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);
}
示例10: 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);
}