Java 类org.apache.logging.log4j.nosql.appender.NoSqlObject 实例源码

项目:spring-boot-boilerplate    文件:XNMongoDbConnection.java   
@Override
public void insertObject(final NoSqlObject<BasicDBObject> object) {

    object.set("clientIP", NetUtils.getIp());
    object.set("clientName", this.clientName);
    try {
        this.collection.insert(object.unwrap(), this.writeConcern);

    } catch (final MongoException e) {
        throw new AppenderLoggingException("Failed to write log event to MongoDB due to error: " + e.getMessage(),
                e);
    }
}
项目:spring-boot-boilerplate    文件:MongoDbObject.java   
@Override
public void set(final String field, final NoSqlObject<BasicDBObject>[] values) {
    final BasicDBList list = new BasicDBList();
    for (final NoSqlObject<BasicDBObject> value : values) {
        list.add(value.unwrap());
    }
    this.mongoObject.append(field, list);
}
项目:influxdb-log4j2    文件:InfluxDbConnection.java   
@Override
public void insertObject(NoSqlObject<Map<String, Object>> object) {
    BatchPoints batchPoints = BatchPoints
               .database(database)
               .retentionPolicy("default")
               .consistency(ConsistencyLevel.ALL)
               .build();

    InfluxMapToSeriesConverter converter = new InfluxMapToSeriesConverter(this.seriesName, batchPoints);
    BatchPoints bpoints = converter.convertToBatchPoints(object.unwrap());

    //TODO: did not find the udp impl of the influx-java driver. fix this for using udp.
    influxDB.write(bpoints);

}
项目:log4j2-elasticsearch-http    文件:ElasticsearchHttpConnection.java   
@Override
public void insertObject(final NoSqlObject<Map<String, Object>> object) {
    try {
        client.index(object.unwrap());
    } catch (Exception e) {
        throw new AppenderLoggingException("failed to write log event to Elasticsearch HTTP: " + e.getMessage(), e);
    }
}
项目:spring-boot-boilerplate    文件:MongoDbObject.java   
@Override
public void set(final String field, final NoSqlObject<BasicDBObject> value) {
    this.mongoObject.append(field, value.unwrap());
}
项目:influxdb-log4j2    文件:InfluxDbObject.java   
@Override
public void set(final String field, final NoSqlObject<InfluxDbNoSqlObject> value) {
    this.data.addItem(field, value);
}
项目:influxdb-log4j2    文件:InfluxDbObject.java   
@Override
public void set(String field, NoSqlObject<InfluxDbNoSqlObject>[] values) {
    this.data.addItem(field, values);
}