Added javadoc

This commit is contained in:
2021-03-26 16:22:13 +01:00
parent 843f8c748c
commit 3d617fa3f3
2 changed files with 43 additions and 3 deletions

View File

@@ -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();