package org.nl.system.service.lucene;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.UnsynchronizedAppenderBase;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.IndexWriter;
import org.nl.config.lucene.LuceneServiceAutoRun;

/**
 * @author ldjun
 * @version 1.0
 * @date 2023年05月12日 9:40
 * @desc desc
 */
public  class LuceneDefaultAppender extends  UnsynchronizedAppenderBase<ILoggingEvent> {

    @Override
    protected void append(ILoggingEvent eventObject) {
        IndexWriter indexWriter = LuceneServiceAutoRun.getIndexWriter();
        Document document = new Document();
        document.add(new StringField("status_code", "01", Field.Store.YES));

    }

}
