Added javadoc
This commit is contained in:
@@ -15,7 +15,10 @@ import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.Protocol;
|
||||
|
||||
//TODO: Add javadoc
|
||||
/**
|
||||
* Class is used to insert logs directly to Redis. {@link com.release11.klaus.repository.EventRepositoryImpl} is using those logs.
|
||||
* @author Rafał Żukowicz
|
||||
*/
|
||||
public class RedisAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||
|
||||
JedisPool pool;
|
||||
@@ -37,6 +40,10 @@ public class RedisAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||
jsonlayout = new JSONEventLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends JedisPool by another log
|
||||
* @param event object containing log info
|
||||
*/
|
||||
@Override
|
||||
protected void append(ILoggingEvent event) {
|
||||
Jedis client = pool.getResource();
|
||||
@@ -208,6 +215,9 @@ public class RedisAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts new instance of JedisPool
|
||||
*/
|
||||
@Override
|
||||
public void start() {
|
||||
super.start();
|
||||
@@ -216,6 +226,9 @@ public class RedisAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
|
||||
pool = new JedisPool(config, host, port, timeout, password, database);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops and destroys JedisPool object
|
||||
*/
|
||||
@Override
|
||||
public void stop() {
|
||||
super.stop();
|
||||
|
||||
Reference in New Issue
Block a user