|
|
|
@ -21,17 +21,18 @@ import java.util.Arrays; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import com.mongodb.BasicDBList; |
|
|
|
|
|
|
|
import com.mongodb.BasicDBObject; |
|
|
|
|
|
|
|
import com.mongodb.DB; |
|
|
|
|
|
|
|
import com.mongodb.Mongo; |
|
|
|
|
|
|
|
import com.mongodb.WriteConcern; |
|
|
|
|
|
|
|
import org.apache.log4j.AppenderSkeleton; |
|
|
|
import org.apache.log4j.AppenderSkeleton; |
|
|
|
import org.apache.log4j.Level; |
|
|
|
import org.apache.log4j.Level; |
|
|
|
import org.apache.log4j.MDC; |
|
|
|
import org.apache.log4j.MDC; |
|
|
|
import org.apache.log4j.PatternLayout; |
|
|
|
import org.apache.log4j.PatternLayout; |
|
|
|
import org.apache.log4j.spi.LoggingEvent; |
|
|
|
import org.apache.log4j.spi.LoggingEvent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.mongodb.BasicDBList; |
|
|
|
|
|
|
|
import com.mongodb.BasicDBObject; |
|
|
|
|
|
|
|
import com.mongodb.DB; |
|
|
|
|
|
|
|
import com.mongodb.Mongo; |
|
|
|
|
|
|
|
import com.mongodb.WriteConcern; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author Jon Brisbin <jbrisbin@vmware.com> |
|
|
|
* @author Jon Brisbin <jbrisbin@vmware.com> |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -129,7 +130,7 @@ public class MongoLog4jAppender extends AppenderSkeleton { |
|
|
|
this.db = mongo.getDB(database); |
|
|
|
this.db = mongo.getDB(database); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings({"unchecked"}) |
|
|
|
@SuppressWarnings({ "unchecked" }) |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void append(final LoggingEvent event) { |
|
|
|
protected void append(final LoggingEvent event) { |
|
|
|
if (null == db) { |
|
|
|
if (null == db) { |
|
|
|
|