Package org.apache.log4j.xml

Examples of org.apache.log4j.xml.XMLLayout


    chooser.setAcceptAllFileFilterUsed(true);
    chooser.setDialogTitle("Save Events to XML file...");
    chooser.showSaveDialog(parent);

    File selectedFile = chooser.getSelectedFile();
    XMLLayout layout = new XMLLayout();
    LoggingEvent event = null;
    PrintWriter out = null;

    if (selectedFile != null) {
      try {
        List v = parent.getCurrentLogPanel().getFilteredEvents();

        if (((v != null) && (v.size() == 0)) || (v == null)) {
          //no events to save
          return;
        }

        Iterator iter = v.iterator();

        out =
          new PrintWriter(new BufferedWriter(new FileWriter(selectedFile)));

        while (iter.hasNext()) {
          event = (LoggingEvent) iter.next();
          layout.setLocationInfo(event.getThrowableInformation() != null);
          out.write(layout.format(event));
        }
      } catch (IOException ioe) {
        ioe.printStackTrace();
      } finally {
        if (out != null) {
View Full Code Here


      if (logDirectory != null) {
        rfa.setMaxBackupIndex(10);
        rfa.setMaxFileSize("10MB");
        Logger.getRootLogger().addAppender(rfa);

        XMLLayout xmlLayout = new XMLLayout();
        xmlLayout.setLocationInfo(true);

        rfa = new RollingFileAppender(xmlLayout, logDirectory + logFNamePrefix + ".xml");
        rfa.setMaxBackupIndex(10);
        rfa.setMaxFileSize("10MB");
        Logger.getRootLogger().addAppender(rfa);
View Full Code Here

      LogLog.error(err);
      throw new IllegalStateException(err);
    }

    if (layout == null) {
        layout = new XMLLayout();
    }
     
    if (advertiseViaMulticastDNS) {
        Map properties = new HashMap();
        properties.put("multicastAddress", remoteHost);
View Full Code Here

      LogLog.error(err);
      throw new IllegalStateException(err);
    }

    if (layout == null) {
        layout = new XMLLayout();
    }

    if (advertiseViaMulticastDNS) {
      zeroConf = new ZeroConfSupport(ZONE, port, getName());
      zeroConf.advertise();
View Full Code Here

TOP

Related Classes of org.apache.log4j.xml.XMLLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.