當前位置: 首頁>>代碼示例>>Java>>正文


Java WriterAppender.setName方法代碼示例

本文整理匯總了Java中org.apache.log4j.WriterAppender.setName方法的典型用法代碼示例。如果您正苦於以下問題:Java WriterAppender.setName方法的具體用法?Java WriterAppender.setName怎麽用?Java WriterAppender.setName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.log4j.WriterAppender的用法示例。


在下文中一共展示了WriterAppender.setName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createLogPanelAppender

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
private void createLogPanelAppender() {
    WriterAppender appender = new WriterAppender() {
        @Override
        public void append(LoggingEvent event) {
            Platform.runLater(() -> serverLog.appendText(layout.format(event)));
        }
    };
    appender.setName("GuiLogger");
    appender.setLayout(new PatternLayout("%d{HH:mm:ss.SSS} - %m%n"));

    org.apache.log4j.Logger.getRootLogger().addAppender(appender);
}
 
開發者ID:anlar,項目名稱:LunaticSMTP,代碼行數:13,代碼來源:MainWindowController.java

示例2: createStringAppender

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
private void createStringAppender() {
  WriterAppender appender = new WriterAppender();
  appender.setName(STRING_APPENDER_NAME);
  appender.setLayout(new PatternLayout());
  appender.activateOptions();
  appender.setWriter(stringWriter);
  Logger.getLogger(ImJavaApiLogger.class).addAppender(appender);
}
 
開發者ID:indigo-dc,項目名稱:im-java-api,代碼行數:9,代碼來源:ImTestWatcher.java

示例3: createWriterAppender

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
public void createWriterAppender() {
    PatternLayout layout = new PatternLayout("%m%n");
    WriterAppender writerAppender = new WriterAppender();
    InputOutput io = IOProvider.getDefault().getIO(Costanti.FLUSSO_SPICY, false);
    writerAppender.setWriter(io.getOut());
    writerAppender.setName("Output Window Appender");
    writerAppender.setLayout(layout);
    org.apache.log4j.Logger.getRootLogger().addAppender(writerAppender);
}
 
開發者ID:dbunibas,項目名稱:spicy,代碼行數:10,代碼來源:Installer.java

示例4: SecureLog

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
/**
 * Constructs a log which writes logs entries to System.out.
 *
 * @param title     Identifies the log entries
 */
public SecureLog(String title) {
    logAppender = new WriterAppender(defaultLayout, defaultLog);
    logAppender.setName(defaultLogName);

    // Configure the logging options
    //logRoot = new SecureCategory(title);
    logRoot = (SecureCategory)SecureCategory.getLogger(title);
    
    logRoot.addAppender(logAppender);
    setLogLevel(DEBUG);
    logEntry(this, DEBUG, 
        "Constructing " + title + " log.  Initial log level is DEBUG.  " +
        "Output will be sent to: " + defaultLogName);
}
 
開發者ID:ModelN,項目名稱:build-management,代碼行數:20,代碼來源:SecureLog.java

示例5: FoxWebLog

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
/**
 * 
 * @param name
 */
public FoxWebLog(final String name) {
  logger = Logger.getLogger(name);
  // add appender to log
  final WriterAppender appender =
      new WriterAppender(new PatternLayout("%d{HH:mm:ss} - %m%n"), consoleWriter);
  appender.setName("CONSOLE_APPENDER");
  appender.setThreshold(Level.INFO);
  logger.removeAllAppenders();
  logger.addAppender(appender);
}
 
開發者ID:dice-group,項目名稱:FOX,代碼行數:15,代碼來源:FoxWebLog.java

示例6: createLogAppender

import org.apache.log4j.WriterAppender; //導入方法依賴的package包/類
public static void createLogAppender(Class clazz, String appenderName, Writer writer) {
    Logger logger = Logger.getLogger(clazz);
    WriterAppender writerAppender = new WriterAppender(new PatternLayout("%d [%t] %-5p %c %x - %m%n"), writer);
    writerAppender.setName(appenderName);
    logger.addAppender(writerAppender);
}
 
開發者ID:sigmoidanalytics,項目名稱:spork,代碼行數:7,代碼來源:Util.java


注:本文中的org.apache.log4j.WriterAppender.setName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。