本文整理了Java中io.airlift.log.Logging.configure()
方法的一些代码示例,展示了Logging.configure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logging.configure()
方法的具体详情如下:
包路径:io.airlift.log.Logging
类名称:Logging
方法名:configure
暂无
代码示例来源:origin: prestodb/presto
logging.configure(config);
代码示例来源:origin: prestodb/presto
@SuppressWarnings("UseOfSystemOutOrSystemErr")
public static void initializeLogging(boolean debug)
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.setLevel("com.facebook.presto", Level.DEBUG);
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
catch (IOException e) {
throw new UncheckedIOException(e);
}
finally {
System.setOut(out);
System.setErr(err);
}
}
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-cli
private static void initializeLogging(boolean debug)
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.setLevel("com.facebook.presto", Level.DEBUG);
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
catch (IOException e) {
throw Throwables.propagate(e);
}
finally {
System.setOut(out);
System.setErr(err);
}
}
代码示例来源:origin: airlift/airship
public static void initializeLogging(boolean debug)
throws IOException
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
finally {
System.setOut(out);
System.setErr(err);
}
}
}
代码示例来源:origin: prestosql/presto
@SuppressWarnings("UseOfSystemOutOrSystemErr")
public static void initializeLogging(boolean debug)
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.setLevel("io.prestosql", Level.DEBUG);
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
catch (IOException e) {
throw new UncheckedIOException(e);
}
finally {
System.setOut(out);
System.setErr(err);
}
}
}
代码示例来源:origin: com.facebook.presto/presto-cli
logging.configure(config);
代码示例来源:origin: uk.co.nichesolutions.presto/presto-cli
logging.configure(config);
代码示例来源:origin: io.prestosql/presto-cli
logging.configure(config);
代码示例来源:origin: prestosql/presto
logging.configure(config);
代码示例来源:origin: airlift/airship
public static void initializeLogging(boolean debug)
throws IOException
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
// TODO: add public level interface to logging framework
new LoggingMBean().setLevel("io.airlift.airship", "DEBUG");
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
finally {
System.setOut(out);
System.setErr(err);
}
}
}
代码示例来源:origin: io.airlift.airship/airship-cli
public static void initializeLogging(boolean debug)
throws IOException
{
// unhook out and err while initializing logging or logger will print to them
PrintStream out = System.out;
PrintStream err = System.err;
try {
if (debug) {
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
// TODO: add public level interface to logging framework
new LoggingMBean().setLevel("io.airlift.airship", "DEBUG");
}
else {
System.setOut(new PrintStream(nullOutputStream()));
System.setErr(new PrintStream(nullOutputStream()));
Logging logging = Logging.initialize();
logging.configure(new LoggingConfiguration());
logging.disableConsole();
}
}
finally {
System.setOut(out);
System.setErr(err);
}
}
}
代码示例来源:origin: airlift/airlift
logging.configure(configuration);
代码示例来源:origin: com.teradata.airlift/bootstrap
logging.configure(configuration);
代码示例来源:origin: io.airlift/bootstrap
logging.configure(configuration);
代码示例来源:origin: airlift/airlift
@Test
public void testRecoverTempFiles()
throws IOException
{
LoggingConfiguration configuration = new LoggingConfiguration();
configuration.setLogPath(new File(tempDir, "launcher.log").getPath());
File logFile1 = new File(tempDir, "test1.log");
Files.touch(logFile1);
File logFile2 = new File(tempDir, "test2.log");
Files.touch(logFile2);
File tempLogFile1 = new File(tempDir, "temp1.tmp");
Files.touch(tempLogFile1);
File tempLogFile2 = new File(tempDir, "temp2.tmp");
Files.touch(tempLogFile2);
Logging logging = Logging.initialize();
logging.configure(configuration);
assertTrue(logFile1.exists());
assertTrue(logFile2.exists());
assertFalse(tempLogFile1.exists());
assertFalse(tempLogFile2.exists());
assertTrue(new File(tempDir, "temp1.log").exists());
assertTrue(new File(tempDir, "temp2.log").exists());
}
代码示例来源:origin: io.airlift/log-manager
@Test
public void testRecoverTempFiles()
throws IOException
{
LoggingConfiguration configuration = new LoggingConfiguration();
configuration.setLogPath(new File(tempDir, "launcher.log").getPath());
File logFile1 = new File(tempDir, "test1.log");
Files.touch(logFile1);
File logFile2 = new File(tempDir, "test2.log");
Files.touch(logFile2);
File tempLogFile1 = new File(tempDir, "temp1.tmp");
Files.touch(tempLogFile1);
File tempLogFile2 = new File(tempDir, "temp2.tmp");
Files.touch(tempLogFile2);
Logging logging = Logging.initialize();
logging.configure(configuration);
assertTrue(logFile1.exists());
assertTrue(logFile2.exists());
assertFalse(tempLogFile1.exists());
assertFalse(tempLogFile2.exists());
assertTrue(new File(tempDir, "temp1.log").exists());
assertTrue(new File(tempDir, "temp2.log").exists());
}
代码示例来源:origin: com.teradata.airlift/log-manager
@Test
public void testRecoverTempFiles()
throws IOException
{
LoggingConfiguration configuration = new LoggingConfiguration();
configuration.setLogPath(new File(tempDir, "launcher.log").getPath());
File logFile1 = new File(tempDir, "test1.log");
Files.touch(logFile1);
File logFile2 = new File(tempDir, "test2.log");
Files.touch(logFile2);
File tempLogFile1 = new File(tempDir, "temp1.tmp");
Files.touch(tempLogFile1);
File tempLogFile2 = new File(tempDir, "temp2.tmp");
Files.touch(tempLogFile2);
Logging logging = Logging.initialize();
logging.configure(configuration);
assertTrue(logFile1.exists());
assertTrue(logFile2.exists());
assertFalse(tempLogFile1.exists());
assertFalse(tempLogFile2.exists());
assertTrue(new File(tempDir, "temp1.log").exists());
assertTrue(new File(tempDir, "temp2.log").exists());
}
内容来源于网络,如有侵权,请联系作者删除!