当前位置: 首页>>代码示例>>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;未经允许,请勿转载。