private void writePacket(Packet packet, Session session) {
        if (!closed) {
            // Add to the logging queue this new entry that will be saved later
            logQueue.add(new AuditPacket(packet.createCopy(), session));
        }
    }
Timer to save queued logs to the XML file.
xmppserver/src/main/java/org/jivesoftware/openfire/audit/spi/AuditorImpl.java