class MongoDBAccessEventAppender extends MongoDBAppenderBase<IAccessEvent> {

    @Override
    protected BasicDBObject toMongoDocument(IAccessEvent event) {
        final BasicDBObject doc = new BasicDBObject();
        doc.append("timeStamp", new Date(event.getTimeStamp()));
        if (serverName)
            doc.append("serverName", event.getServerName());
        addRemote(doc, event);
        addRequest(doc, event);
        addResponse(doc, event);
        return doc;
    }

}