"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/main/java/org/apache/logging/log4j/core/appender/nosql/NoSqlAppender.java" between
apache-log4j-2.11.1-src.tar.gz and apache-log4j-2.11.2-src.tar.gz

About: Apache Log4j 2 is a logging library for Java. Source distribution (Java).

NoSqlAppender.java  (apache-log4j-2.11.1-src):NoSqlAppender.java  (apache-log4j-2.11.2-src)
skipping to change at line 26 skipping to change at line 26
*/ */
package org.apache.logging.log4j.core.appender.nosql; package org.apache.logging.log4j.core.appender.nosql;
import java.io.Serializable; import java.io.Serializable;
import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Filter; import org.apache.logging.log4j.core.Filter;
import org.apache.logging.log4j.core.Layout; import org.apache.logging.log4j.core.Layout;
import org.apache.logging.log4j.core.appender.AbstractAppender; import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender; import org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute; import org.apache.logging.log4j.core.config.plugins.PluginBuilderAttribute;
import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory; import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
import org.apache.logging.log4j.core.config.plugins.PluginElement; import org.apache.logging.log4j.core.config.plugins.PluginElement;
import org.apache.logging.log4j.core.util.Booleans; import org.apache.logging.log4j.core.util.Booleans;
/** /**
* This Appender writes logging events to a NoSQL database using a configured No SQL provider. It requires * This Appender writes logging events to a NoSQL database using a configured No SQL provider. It requires
* implementations of {@link NoSqlObject}, {@link NoSqlConnection}, and {@link N oSqlProvider} to "know" how to write * implementations of {@link NoSqlObject}, {@link NoSqlConnection}, and {@link N oSqlProvider} to "know" how to write
* events to the chosen NoSQL database. * events to the chosen NoSQL database.
skipping to change at line 81 skipping to change at line 82
final String managerName = "noSqlManager{ description=" + name + ", bufferSize=" + bufferSize final String managerName = "noSqlManager{ description=" + name + ", bufferSize=" + bufferSize
+ ", provider=" + provider + " }"; + ", provider=" + provider + " }";
final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSq lDatabaseManager(managerName, final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSq lDatabaseManager(managerName,
bufferSize, provider); bufferSize, provider);
if (manager == null) { if (manager == null) {
return null; return null;
} }
return new NoSqlAppender(name, getFilter(), getLayout(), isIgnoreExc eptions(), manager); return new NoSqlAppender(name, getFilter(), getLayout(), isIgnoreExc eptions(), getPropertyArray(), manager);
} }
/** /**
* Sets the buffer size. * Sets the buffer size.
* *
* @param bufferSize * @param bufferSize
* If an integer greater than 0, this causes the appender to buffer log events and flush whenever the * If an integer greater than 0, this causes the appender to buffer log events and flush whenever the
* buffer reaches this size. * buffer reaches this size.
* @return this * @return this
*/ */
public B setBufferSize(int bufferSize) { public B setBufferSize(final int bufferSize) {
this.bufferSize = bufferSize; this.bufferSize = bufferSize;
return asBuilder(); return asBuilder();
} }
/** /**
* Sets the provider. * Sets the provider.
* *
* @param provider * @param provider
* The NoSQL provider that provides connections to the chosen NoSQL database. * The NoSQL provider that provides connections to the chosen NoSQL database.
* @return this * @return this
*/ */
public B setProvider(NoSqlProvider<?> provider) { public B setProvider(final NoSqlProvider<?> provider) {
this.provider = provider; this.provider = provider;
return asBuilder(); return asBuilder();
} }
} }
/** /**
* Factory method for creating a NoSQL appender within the plugin manager. * Factory method for creating a NoSQL appender within the plugin manager.
* *
* @param name * @param name
* The name of the appender. * The name of the appender.
skipping to change at line 155 skipping to change at line 156
final String managerName = "noSqlManager{ description=" + name + ", buff erSize=" + bufferSizeInt + ", provider=" final String managerName = "noSqlManager{ description=" + name + ", buff erSize=" + bufferSizeInt + ", provider="
+ provider + " }"; + provider + " }";
final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDat abaseManager(managerName, bufferSizeInt, final NoSqlDatabaseManager<?> manager = NoSqlDatabaseManager.getNoSqlDat abaseManager(managerName, bufferSizeInt,
provider); provider);
if (manager == null) { if (manager == null) {
return null; return null;
} }
return new NoSqlAppender(name, filter, null, ignoreExceptions, manager); return new NoSqlAppender(name, filter, null, ignoreExceptions, null, man ager);
} }
@PluginBuilderFactory @PluginBuilderFactory
public static <B extends Builder<B>> B newBuilder() { public static <B extends Builder<B>> B newBuilder() {
return new Builder<B>().asBuilder(); return new Builder<B>().asBuilder();
} }
private final String description; private final String description;
private NoSqlAppender(final String name, final Filter filter, Layout<? exten private NoSqlAppender(final String name, final Filter filter, final Layout<?
ds Serializable> layout, extends Serializable> layout,
final boolean ignoreExceptions, final NoSqlDatabaseManager<?> manage final boolean ignoreExceptions, final Property[] properties, final N
r) { oSqlDatabaseManager<?> manager) {
super(name, filter, layout, ignoreExceptions, manager); super(name, filter, layout, ignoreExceptions, properties, manager);
this.description = this.getName() + "{ manager=" + this.getManager() + " }"; this.description = this.getName() + "{ manager=" + this.getManager() + " }";
} }
@Override @Override
public String toString() { public String toString() {
return this.description; return this.description;
} }
} }
 End of changes. 6 change blocks. 
9 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)