"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "log4j-core/src/main/java/org/apache/logging/log4j/core/appender/RandomAccessFileAppender.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).

RandomAccessFileAppender.java  (apache-log4j-2.11.1-src):RandomAccessFileAppender.java  (apache-log4j-2.11.2-src)
skipping to change at line 30 skipping to change at line 30
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Core; import org.apache.logging.log4j.core.Core;
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.LogEvent; import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.Configuration;
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.net.Advertiser; import org.apache.logging.log4j.core.net.Advertiser;
import org.apache.logging.log4j.core.util.Booleans; import org.apache.logging.log4j.core.util.Booleans;
import org.apache.logging.log4j.core.util.Integers; import org.apache.logging.log4j.core.util.Integers;
/** /**
* File Appender. * File Appender.
*/ */
skipping to change at line 85 skipping to change at line 86
} }
final Layout<? extends Serializable> layout = getOrCreateLayout(); final Layout<? extends Serializable> layout = getOrCreateLayout();
final boolean immediateFlush = isImmediateFlush(); final boolean immediateFlush = isImmediateFlush();
final RandomAccessFileManager manager = RandomAccessFileManager.getF ileManager(fileName, append, final RandomAccessFileManager manager = RandomAccessFileManager.getF ileManager(fileName, append,
immediateFlush, getBufferSize(), advertiseURI, layout, null) ; immediateFlush, getBufferSize(), advertiseURI, layout, null) ;
if (manager == null) { if (manager == null) {
return null; return null;
} }
return new RandomAccessFileAppender(name, layout, getFilter(), manag er, fileName, isIgnoreExceptions(), return new RandomAccessFileAppender(name, layout, getFilter(), manag er, fileName, isIgnoreExceptions(),
immediateFlush, advertise ? getConfiguration().getAdvertiser () : null); immediateFlush, advertise ? getConfiguration().getAdvertiser () : null, getPropertyArray());
} }
public B setFileName(final String fileName) { public B setFileName(final String fileName) {
this.fileName = fileName; this.fileName = fileName;
return asBuilder(); return asBuilder();
} }
public B setAppend(final boolean append) { public B setAppend(final boolean append) {
this.append = append; this.append = append;
return asBuilder(); return asBuilder();
skipping to change at line 116 skipping to change at line 117
} }
} }
private final String fileName; private final String fileName;
private Object advertisement; private Object advertisement;
private final Advertiser advertiser; private final Advertiser advertiser;
private RandomAccessFileAppender(final String name, final Layout<? extends S erializable> layout, private RandomAccessFileAppender(final String name, final Layout<? extends S erializable> layout,
final Filter filter, final RandomAccessFileManager manager, final St ring filename, final Filter filter, final RandomAccessFileManager manager, final St ring filename,
final boolean ignoreExceptions, final boolean immediateFlush, final final boolean ignoreExceptions, final boolean immediateFlush, final
Advertiser advertiser) { Advertiser advertiser,
final Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, manager); super(name, layout, filter, ignoreExceptions, immediateFlush, properties , manager);
if (advertiser != null) { if (advertiser != null) {
final Map<String, String> configuration = new HashMap<>( final Map<String, String> configuration = new HashMap<>(
layout.getContentFormat()); layout.getContentFormat());
configuration.putAll(manager.getContentFormat()); configuration.putAll(manager.getContentFormat());
configuration.put("contentType", layout.getContentType()); configuration.put("contentType", layout.getContentType());
configuration.put("name", name); configuration.put("name", name);
advertisement = advertiser.advertise(configuration); advertisement = advertiser.advertise(configuration);
} }
this.fileName = filename; this.fileName = filename;
this.advertiser = advertiser; this.advertiser = advertiser;
skipping to change at line 225 skipping to change at line 227
final String advertiseURI, final String advertiseURI,
final Configuration configuration) { final Configuration configuration) {
final boolean isAppend = Booleans.parseBoolean(append, true); final boolean isAppend = Booleans.parseBoolean(append, true);
final boolean isFlush = Booleans.parseBoolean(immediateFlush, true); final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true); final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
final boolean isAdvertise = Boolean.parseBoolean(advertise); final boolean isAdvertise = Boolean.parseBoolean(advertise);
final int bufferSize = Integers.parseInt(bufferSizeStr, RandomAccessFile Manager.DEFAULT_BUFFER_SIZE); final int bufferSize = Integers.parseInt(bufferSizeStr, RandomAccessFile Manager.DEFAULT_BUFFER_SIZE);
return RandomAccessFileAppender.<B>newBuilder() return RandomAccessFileAppender.<B>newBuilder()
.setAdvertise(isAdvertise) .setAdvertise(isAdvertise)
.setAdvertiseURI(advertiseURI) .setAdvertiseURI(advertiseURI)
.setAppend(isAppend) .setAppend(isAppend)
.withBufferSize(bufferSize) .withBufferSize(bufferSize)
.setConfiguration(configuration) .setConfiguration(configuration)
.setFileName(fileName) .setFileName(fileName).setFilter(filter).setIgnoreExceptions(ignoreExcep
.withFilter(filter) tions)
.withIgnoreExceptions(ignoreExceptions) .withImmediateFlush(isFlush).setLayout(layout).setName(name)
.withImmediateFlush(isFlush)
.withLayout(layout)
.withName(name)
.build(); .build();
} }
/** /**
* Creates a builder for a RandomAccessFileAppender. * Creates a builder for a RandomAccessFileAppender.
* @return a builder for a RandomAccessFileAppender. * @return a builder for a RandomAccessFileAppender.
*/ */
@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();
 End of changes. 5 change blocks. 
15 lines changed or deleted 14 lines changed or added

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