public void writeConfiguration()

in log4j-converter-config/src/main/java/org/apache/logging/converter/config/internal/v2/XmlConfigurationMapper.java [75:96]


    public void writeConfiguration(OutputStream outputStream, ConfigurationNode configuration) throws IOException {
        XMLStreamWriter streamWriter = createStreamWriter(outputStream);
        try {
            streamWriter.writeStartDocument();
            streamWriter.setDefaultNamespace(LOG4J_NAMESPACE_URI);
            streamWriter.writeStartElement(LOG4J_NAMESPACE_URI, configuration.getPluginName());
            // Register the namespaces
            streamWriter.writeDefaultNamespace(LOG4J_NAMESPACE_URI);
            streamWriter.writeNamespace("xsi", XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
            streamWriter.writeAttribute(
                    XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "schemaLocation", LOG4J_SCHEMA_LOCATION);
            // Write the content of the file
            writeNodeContentToStreamWriter(configuration, streamWriter);
            streamWriter.writeEndElement();
            streamWriter.writeEndDocument();
            streamWriter.flush();
        } catch (XMLStreamException e) {
            throw new IOException("Unable to write configuration.", e);
        } finally {
            closeStreamWriter(streamWriter);
        }
    }