CPD Results
The following document contains the results of PMD's CPD 6.4.0.
Duplications
File |
Line |
org/apache/logging/log4j/core/filter/LevelRangeFilter.java |
108 |
org/apache/logging/log4j/core/filter/ThresholdFilter.java |
75 |
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8, final Object p9) {
return filter(level);
}
public Level getMinLevel() { |
File |
Line |
org/apache/logging/log4j/core/filter/BurstFilter.java |
115 |
org/apache/logging/log4j/core/filter/LevelRangeFilter.java |
107 |
return filter(event.getLevel());
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8, final Object p9) {
return filter(level);
} |
File |
Line |
org/apache/logging/log4j/core/filter/BurstFilter.java |
116 |
org/apache/logging/log4j/core/filter/ThresholdFilter.java |
75 |
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8) {
return filter(level);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8, final Object p9) {
return filter(level);
} |
File |
Line |
org/apache/logging/log4j/core/filter/MarkerFilter.java |
72 |
org/apache/logging/log4j/core/filter/NoMarkerFilter.java |
63 |
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8, final Object p9) {
return filter(marker);
} |
File |
Line |
org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java |
126 |
org/apache/logging/log4j/core/filter/TimeFilter.java |
147 |
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8) {
return filter();
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object p0, final Object p1, final Object p2, final Object p3,
final Object p4, final Object p5, final Object p6,
final Object p7, final Object p8, final Object p9) {
return filter();
}
// TODO Consider refactoring to use AbstractFilter.AbstractFilterBuilder
@PluginFactory |
File |
Line |
org/apache/logging/log4j/core/layout/JsonLayout.java |
158 |
org/apache/logging/log4j/core/layout/YamlLayout.java |
96 |
super(config, new JacksonFactory.JSON(encodeThreadContextAsList, includeStacktrace, stacktraceAsString, objectMessageAsJsonObject).newWriter(
locationInfo, properties, compact),
charset, compact, complete, eventEol, endOfLine,
PatternLayout.newSerializerBuilder().setConfiguration(config).setPattern(headerPattern).setDefaultPattern(DEFAULT_HEADER).build(),
PatternLayout.newSerializerBuilder().setConfiguration(config).setPattern(footerPattern).setDefaultPattern(DEFAULT_FOOTER).build(),
includeNullDelimiter,
additionalFields);
}
/**
* Returns appropriate JSON header.
*
* @return a byte array containing the header, opening the JSON array.
*/
@Override
public byte[] getHeader() {
if (!this.complete) {
return null;
}
final StringBuilder buf = new StringBuilder();
final String str = serializeToString(getHeaderSerializer());
if (str != null) {
buf.append(str);
}
buf.append(this.eol);
return getBytes(buf.toString());
}
/**
* Returns appropriate JSON footer.
*
* @return a byte array containing the footer, closing the JSON array.
*/
@Override
public byte[] getFooter() {
if (!this.complete) {
return null;
}
final StringBuilder buf = new StringBuilder();
buf.append(this.eol);
final String str = serializeToString(getFooterSerializer());
if (str != null) {
buf.append(str);
}
buf.append(this.eol);
return getBytes(buf.toString());
}
@Override
public Map<String, String> getContentFormat() {
final Map<String, String> result = new HashMap<>();
result.put("version", "2.0");
return result;
}
/**
* @return The content type.
*/
@Override
public String getContentType() {
return CONTENT_TYPE + "; charset=" + this.getCharset();
}
/**
* Creates a JSON Layout.
* @param config
* The plugin configuration.
* @param locationInfo
* If "true", includes the location information in the generated JSON.
* @param properties
* If "true", includes the thread context map in the generated JSON.
* @param propertiesAsList
* If true, the thread context map is included as a list of map entry objects, where each entry has
* a "key" attribute (whose value is the key) and a "value" attribute (whose value is the value).
* Defaults to false, in which case the thread context map is included as a simple map of key-value
* pairs.
* @param complete
* If "true", includes the JSON header and footer, and comma between records.
* @param compact
* If "true", does not use end-of-lines and indentation, defaults to "false".
* @param eventEol
* If "true", forces an EOL after each log event (even if compact is "true"), defaults to "false". This
* allows one even per line, even in compact mode.
* @param headerPattern
* The header pattern, defaults to {@code "["} if null.
* @param footerPattern
* The header pattern, defaults to {@code "]"} if null.
* @param charset
* The character set to use, if {@code null}, uses "UTF-8".
* @param includeStacktrace
* If "true", includes the stacktrace of any Throwable in the generated JSON, defaults to "true".
* @return A JSON Layout.
*
* @deprecated Use {@link #newBuilder()} instead
*/
@Deprecated
public static JsonLayout createLayout( |
File |
Line |
org/apache/logging/log4j/core/config/AwaitCompletionReliabilityStrategy.java |
47 |
org/apache/logging/log4j/core/config/LockingReliabilityStrategy.java |
40 |
this.loggerConfig = Objects.requireNonNull(loggerConfig, "loggerConfig is null");
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, org.apache.logging.log4j.Marker, org.apache.logging.log4j.Level,
* org.apache.logging.log4j.message.Message, java.lang.Throwable)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final String loggerName, final String fqcn,
final Marker marker, final Level level, final Message data, final Throwable t) {
final LoggerConfig config = getActiveLoggerConfig(reconfigured);
try {
config.log(loggerName, fqcn, marker, level, data, t);
} finally {
config.getReliabilityStrategy().afterLogEvent();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, java.lang.StackTraceElement, org.apache.logging.log4j.Marker,
* org.apache.logging.log4j.Level, org.apache.logging.log4j.message.Message, java.lang.Throwable)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final String loggerName, final String fqcn,
final StackTraceElement location, final Marker marker, final Level level, final Message data,
final Throwable t) {
final LoggerConfig config = getActiveLoggerConfig(reconfigured);
try {
config.log(loggerName, fqcn, location, marker, level, data, t);
} finally {
config.getReliabilityStrategy().afterLogEvent();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* org.apache.logging.log4j.core.LogEvent)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final LogEvent event) {
final LoggerConfig config = getActiveLoggerConfig(reconfigured);
try {
config.log(event);
} finally {
config.getReliabilityStrategy().afterLogEvent();
}
}
/*
* (non-Javadoc)
*
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeLogEvent(org.apache.logging.log4j.core.config.
* LoggerConfig, org.apache.logging.log4j.util.Supplier)
*/
@Override
public LoggerConfig getActiveLoggerConfig(final Supplier<LoggerConfig> next) {
LoggerConfig result = this.loggerConfig;
if (!beforeLogEvent()) {
result = next.get();
return result == this.loggerConfig ? result : result.getReliabilityStrategy().getActiveLoggerConfig(next);
}
return result;
}
private boolean beforeLogEvent() { |
File |
Line |
org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java |
94 |
org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java |
93 |
@JsonProperty(JsonConstants.ELT_MESSAGE)
@JsonDeserialize(using = SimpleMessageDeserializer.class)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_MESSAGE)
@Override
public abstract Message getMessage();
@JsonProperty(JsonConstants.ELT_SOURCE)
@JsonDeserialize(using = Log4jStackTraceElementDeserializer.class)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_SOURCE)
@Override
public abstract StackTraceElement getSource();
@Override
@JsonProperty("threadId")
@JacksonXmlProperty(isAttribute = true, localName = "threadId")
public abstract long getThreadId();
@Override
@JsonProperty("thread")
@JacksonXmlProperty(isAttribute = true, localName = "thread")
public abstract String getThreadName();
@Override
@JsonProperty("threadPriority")
@JacksonXmlProperty(isAttribute = true, localName = "threadPriority")
public abstract int getThreadPriority();
@JsonIgnore
@Override
public abstract Throwable getThrown();
@JsonProperty(JsonConstants.ELT_THROWN)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_THROWN)
@Override
public abstract ThrowableProxy getThrownProxy();
@JsonIgnore // ignore from 2.11
// @JsonProperty()
// @JacksonXmlProperty(isAttribute = true)
@Override
public abstract long getTimeMillis();
@JsonProperty(JsonConstants.ELT_INSTANT)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_INSTANT)
@Override
public abstract Instant getInstant();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract boolean isEndOfBatch();
@JsonIgnore
@Override
public abstract boolean isIncludeLocation();
@Override
public abstract void setEndOfBatch(boolean endOfBatch);
@Override
public abstract void setIncludeLocation(boolean locationRequired);
} |
File |
Line |
org/apache/logging/log4j/core/appender/AbstractFileAppender.java |
72 |
org/apache/logging/log4j/core/appender/FileAppender.java |
107 |
public String getAdvertiseUri() {
return advertiseUri;
}
public String getFileName() {
return fileName;
}
public boolean isAdvertise() {
return advertise;
}
public boolean isAppend() {
return append;
}
public boolean isCreateOnDemand() {
return createOnDemand;
}
public boolean isLocking() {
return locking;
}
public String getFilePermissions() {
return filePermissions;
}
public String getFileOwner() {
return fileOwner;
}
public String getFileGroup() {
return fileGroup;
}
public B withAdvertise(final boolean advertise) {
this.advertise = advertise;
return asBuilder();
}
public B withAdvertiseUri(final String advertiseUri) {
this.advertiseUri = advertiseUri;
return asBuilder();
}
public B withAppend(final boolean append) {
this.append = append;
return asBuilder();
}
public B withFileName(final String fileName) {
this.fileName = fileName;
return asBuilder();
}
public B withCreateOnDemand(final boolean createOnDemand) {
this.createOnDemand = createOnDemand;
return asBuilder();
}
public B withLocking(final boolean locking) {
this.locking = locking;
return asBuilder();
}
public B withFilePermissions(final String filePermissions) {
this.filePermissions = filePermissions;
return asBuilder();
}
public B withFileOwner(final String fileOwner) {
this.fileOwner = fileOwner;
return asBuilder();
}
public B withFileGroup(final String fileGroup) {
this.fileGroup = fileGroup;
return asBuilder();
}
}
private final String fileName; |
File |
Line |
org/apache/logging/log4j/core/util/CronExpression.java |
1266 |
org/apache/logging/log4j/core/util/CronExpression.java |
1302 |
final java.util.Calendar tcal = java.util.Calendar.getInstance(getTimeZone());
tcal.set(Calendar.SECOND, 0);
tcal.set(Calendar.MINUTE, 0);
tcal.set(Calendar.HOUR_OF_DAY, 0);
tcal.set(Calendar.DAY_OF_MONTH, day);
tcal.set(Calendar.MONTH, mon - 1);
tcal.set(Calendar.YEAR, cl.get(Calendar.YEAR));
final int ldom = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
final int dow = tcal.get(Calendar.DAY_OF_WEEK);
if (dow == Calendar.SATURDAY && day == 1) {
day += 2;
} else if (dow == Calendar.SATURDAY) {
day -= 1;
} else if (dow == Calendar.SUNDAY && day == ldom) {
day -= 2;
} else if (dow == Calendar.SUNDAY) {
day += 1;
}
tcal.set(Calendar.SECOND, sec);
tcal.set(Calendar.MINUTE, min);
tcal.set(Calendar.HOUR_OF_DAY, hr);
tcal.set(Calendar.DAY_OF_MONTH, day);
tcal.set(Calendar.MONTH, mon - 1);
final Date nTime = tcal.getTime();
if (nTime.before(afterTime)) {
day = 1; |
File |
Line |
org/apache/logging/log4j/core/appender/FileAppender.java |
103 |
org/apache/logging/log4j/core/appender/RollingFileAppender.java |
156 |
!bufferedIo || isImmediateFlush(), advertise ? getConfiguration().getAdvertiser() : null,
getPropertyArray());
}
public String getAdvertiseUri() {
return advertiseUri;
}
public String getFileName() {
return fileName;
}
public boolean isAdvertise() {
return advertise;
}
public boolean isAppend() {
return append;
}
public boolean isCreateOnDemand() {
return createOnDemand;
}
public boolean isLocking() {
return locking;
}
public String getFilePermissions() {
return filePermissions;
}
public String getFileOwner() {
return fileOwner;
}
public String getFileGroup() {
return fileGroup;
}
public B withAdvertise(final boolean advertise) {
this.advertise = advertise;
return asBuilder();
}
public B withAdvertiseUri(final String advertiseUri) {
this.advertiseUri = advertiseUri;
return asBuilder();
}
public B withAppend(final boolean append) {
this.append = append;
return asBuilder();
}
public B withFileName(final String fileName) {
this.fileName = fileName;
return asBuilder();
}
public B withCreateOnDemand(final boolean createOnDemand) {
this.createOnDemand = createOnDemand;
return asBuilder();
}
public B withLocking(final boolean locking) {
this.locking = locking;
return asBuilder();
}
public B withFilePermissions(final String filePermissions) { |
File |
Line |
org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java |
131 |
org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java |
116 |
final Filter filter, final MemoryMappedFileManager manager, final String filename,
final boolean ignoreExceptions, final boolean immediateFlush, final Advertiser advertiser,
final Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, properties, manager);
if (advertiser != null) {
final Map<String, String> configuration = new HashMap<>(layout.getContentFormat());
configuration.putAll(manager.getContentFormat());
configuration.put("contentType", layout.getContentType());
configuration.put("name", name);
advertisement = advertiser.advertise(configuration);
}
this.fileName = filename;
this.advertiser = advertiser;
}
@Override
public boolean stop(final long timeout, final TimeUnit timeUnit) {
setStopping();
super.stop(timeout, timeUnit, false);
if (advertiser != null) {
advertiser.unadvertise(advertisement);
}
setStopped();
return true;
}
/**
* Write the log entry rolling over the file when required.
*
* @param event The LogEvent.
*/
@Override
public void append(final LogEvent event) {
// Leverage the nice batching behaviour of async Loggers/Appenders:
// we can signal the file manager that it needs to flush the buffer
// to disk at the end of a batch.
// From a user's point of view, this means that all log events are
// _always_ available in the log file, without incurring the overhead
// of immediateFlush=true.
getManager().setEndOfBatch(event.isEndOfBatch()); // FIXME manager's EndOfBatch threadlocal can be deleted
super.append(event); // TODO should only call force() if immediateFlush && endOfBatch?
}
/**
* Returns the file name this appender is associated with.
*
* @return The File name.
*/
public String getFileName() {
return this.fileName;
}
/**
* Returns the length of the memory mapped region.
*
* @return the length of the memory mapped region
*/
public int getRegionLength() { |
File |
Line |
org/apache/logging/log4j/core/config/LoggerConfig.java |
382 |
org/apache/logging/log4j/core/config/LoggerConfig.java |
431 |
public void log(final String loggerName, final String fqcn, final Marker marker, final Level level,
final Message data, final Throwable t) {
List<Property> props = null;
if (!propertiesRequireLookup) {
props = properties;
} else {
if (properties != null) {
props = new ArrayList<>(properties.size());
final LogEvent event = Log4jLogEvent.newBuilder()
.setMessage(data)
.setMarker(marker)
.setLevel(level)
.setLoggerName(loggerName)
.setLoggerFqcn(fqcn)
.setThrown(t)
.build();
for (int i = 0; i < properties.size(); i++) {
final Property prop = properties.get(i);
final String value = prop.isValueNeedsLookup() // since LOG4J2-1575
? config.getStrSubstitutor().replace(event, prop.getValue()) //
: prop.getValue();
props.add(Property.createProperty(prop.getName(), value));
}
}
}
final LogEvent logEvent = logEventFactory instanceof LocationAwareLogEventFactory ?
((LocationAwareLogEventFactory) logEventFactory).createEvent(loggerName, marker, fqcn, requiresLocation() ? |
File |
Line |
org/apache/logging/log4j/core/appender/AbstractFileAppender.java |
72 |
org/apache/logging/log4j/core/appender/RollingFileAppender.java |
160 |
public String getAdvertiseUri() {
return advertiseUri;
}
public String getFileName() {
return fileName;
}
public boolean isAdvertise() {
return advertise;
}
public boolean isAppend() {
return append;
}
public boolean isCreateOnDemand() {
return createOnDemand;
}
public boolean isLocking() {
return locking;
}
public String getFilePermissions() {
return filePermissions;
}
public String getFileOwner() {
return fileOwner;
}
public String getFileGroup() {
return fileGroup;
}
public B withAdvertise(final boolean advertise) {
this.advertise = advertise;
return asBuilder();
}
public B withAdvertiseUri(final String advertiseUri) {
this.advertiseUri = advertiseUri;
return asBuilder();
}
public B withAppend(final boolean append) {
this.append = append;
return asBuilder();
}
public B withFileName(final String fileName) {
this.fileName = fileName;
return asBuilder();
}
public B withCreateOnDemand(final boolean createOnDemand) {
this.createOnDemand = createOnDemand;
return asBuilder();
}
public B withLocking(final boolean locking) {
this.locking = locking;
return asBuilder();
}
public B withFilePermissions(final String filePermissions) { |
File |
Line |
org/apache/logging/log4j/core/config/AwaitUnconditionallyReliabilityStrategy.java |
45 |
org/apache/logging/log4j/core/config/DefaultReliabilityStrategy.java |
36 |
DEFAULT_SLEEP_MILLIS);
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, org.apache.logging.log4j.Marker, org.apache.logging.log4j.Level,
* org.apache.logging.log4j.message.Message, java.lang.Throwable)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final String loggerName, final String fqcn, final Marker marker, final Level level,
final Message data, final Throwable t) {
loggerConfig.log(loggerName, fqcn, marker, level, data, t);
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* java.lang.String, java.lang.String, java.lang.StackTraceElement, org.apache.logging.log4j.Marker,
* org.apache.logging.log4j.Level, org.apache.logging.log4j.message.Message, java.lang.Throwable)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final String loggerName, final String fqcn,
final StackTraceElement location, final Marker marker, final Level level, final Message data,
final Throwable t) {
loggerConfig.log(loggerName, fqcn, location, marker, level, data, t);
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#log(org.apache.logging.log4j.util.Supplier,
* org.apache.logging.log4j.core.LogEvent)
*/
@Override
public void log(final Supplier<LoggerConfig> reconfigured, final LogEvent event) {
loggerConfig.log(event);
}
/*
* (non-Javadoc)
*
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeLogEvent(org.apache.logging.log4j.core.config.
* LoggerConfig, org.apache.logging.log4j.util.Supplier)
*/
@Override
public LoggerConfig getActiveLoggerConfig(final Supplier<LoggerConfig> next) {
return this.loggerConfig;
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#afterLogEvent()
*/
@Override
public void afterLogEvent() {
// no action
}
/*
* (non-Javadoc)
*
* @see org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopAppenders()
*/
@Override
public void beforeStopAppenders() {
// no action
}
/*
* (non-Javadoc)
*
* @see
* org.apache.logging.log4j.core.config.ReliabilityStrategy#beforeStopConfiguration(org.apache.logging.log4j.core
* .config.Configuration)
*/
@Override
public void beforeStopConfiguration(final Configuration configuration) { |
File |
Line |
org/apache/logging/log4j/core/appender/AbstractFileAppender.java |
162 |
org/apache/logging/log4j/core/appender/FileAppender.java |
256 |
final M manager, final String filename, final boolean ignoreExceptions,
final boolean immediateFlush, final Advertiser advertiser, final Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, properties, manager);
if (advertiser != null) {
final Map<String, String> configuration = new HashMap<>(layout.getContentFormat());
configuration.putAll(manager.getContentFormat());
configuration.put("contentType", layout.getContentType());
configuration.put("name", name);
advertisement = advertiser.advertise(configuration);
} else {
advertisement = null;
}
this.fileName = filename;
this.advertiser = advertiser;
}
/**
* Returns the file name this appender is associated with.
* @return The File name.
*/
public String getFileName() {
return this.fileName;
}
@Override
public boolean stop(final long timeout, final TimeUnit timeUnit) {
setStopping();
super.stop(timeout, timeUnit, false);
if (advertiser != null) {
advertiser.unadvertise(advertisement);
}
setStopped();
return true;
}
} |
File |
Line |
org/apache/logging/log4j/core/layout/MarkerPatternSelector.java |
214 |
org/apache/logging/log4j/core/layout/ScriptPatternSelector.java |
241 |
final Builder builder = newBuilder();
builder.setProperties(properties);
builder.setDefaultPattern(defaultPattern);
builder.setAlwaysWriteExceptions(alwaysWriteExceptions);
builder.setNoConsoleNoAnsi(noConsoleNoAnsi);
builder.setConfiguration(configuration);
return builder.build();
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
boolean first = true;
for (final Map.Entry<String, String> entry : patternMap.entrySet()) {
if (!first) {
sb.append(", ");
}
sb.append("key=\"").append(entry.getKey()).append("\", pattern=\"").append(entry.getValue()).append("\"");
first = false;
}
if (!first) {
sb.append(", ");
}
sb.append("default=\"").append(defaultPattern).append("\"");
return sb.toString();
}
} |
File |
Line |
org/apache/logging/log4j/core/filter/MapFilter.java |
245 |
org/apache/logging/log4j/core/filter/StructuredDataFilter.java |
165 |
org/apache/logging/log4j/core/filter/ThreadContextMapFilter.java |
205 |
LOGGER.error("keys and values must be specified for the MapFilter");
return null;
}
final Map<String, List<String>> map = new HashMap<>();
for (final KeyValuePair pair : pairs) {
final String key = pair.getKey();
if (key == null) {
LOGGER.error("A null key is not valid in MapFilter");
continue;
}
final String value = pair.getValue();
if (value == null) {
LOGGER.error("A null value for key " + key + " is not allowed in MapFilter");
continue;
}
List<String> list = map.get(pair.getKey());
if (list != null) {
list.add(value);
} else {
list = new ArrayList<>();
list.add(value);
map.put(pair.getKey(), list);
}
}
if (map.isEmpty()) {
LOGGER.error("MapFilter is not configured with any valid key value pairs"); |
File |
Line |
org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java |
194 |
org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java |
115 |
return this;
}
public String getCompressionLevelStr() {
return compressionLevelStr;
}
/**
* Defines compression level.
*
* @param compressionLevelStr The compression level, 0 (less) through 9 (more); applies only to ZIP files.
* @return This builder for chaining convenience
*/
public Builder withCompressionLevelStr(final String compressionLevelStr) {
this.compressionLevelStr = compressionLevelStr;
return this;
}
public Action[] getCustomActions() {
return customActions;
}
/**
* Defines custom actions.
*
* @param customActions custom actions to perform asynchronously after rollover
* @return This builder for chaining convenience
*/
public Builder withCustomActions(final Action[] customActions) {
this.customActions = customActions;
return this;
}
public boolean isStopCustomActionsOnError() {
return stopCustomActionsOnError;
}
/**
* Defines whether to stop executing asynchronous actions if an error occurs.
*
* @param stopCustomActionsOnError whether to stop executing asynchronous actions if an error occurs
* @return This builder for chaining convenience
*/
public Builder withStopCustomActionsOnError(final boolean stopCustomActionsOnError) {
this.stopCustomActionsOnError = stopCustomActionsOnError;
return this;
}
public String getTempCompressedFilePattern() {
return tempCompressedFilePattern;
}
/**
* Defines temporary compression file pattern.
*
* @param tempCompressedFilePattern File pattern of the working file pattern used during compression, if null no temporary file are used
* @return This builder for chaining convenience
*/
public Builder withTempCompressedFilePattern(final String tempCompressedFilePattern) {
this.tempCompressedFilePattern = tempCompressedFilePattern;
return this;
}
public Configuration getConfig() {
return config;
}
/**
* Defines configuration.
*
* @param config The Configuration.
* @return This builder for chaining convenience
*/
public Builder withConfig(final Configuration config) {
this.config = config;
return this;
}
}
@PluginBuilderFactory
public static Builder newBuilder() {
return new Builder();
}
/**
* Creates the DefaultRolloverStrategy.
*
* @param max The maximum number of files to keep.
* @param min The minimum number of files to keep.
* @param fileIndex If set to "max" (the default), files with a higher index will be newer than files with a smaller
* index. If set to "min", file renaming and the counter will follow the Fixed Window strategy.
* @param compressionLevelStr The compression level, 0 (less) through 9 (more); applies only to ZIP files.
* @param customActions custom actions to perform asynchronously after rollover
* @param stopCustomActionsOnError whether to stop executing asynchronous actions if an error occurs
* @param config The Configuration.
* @return A DefaultRolloverStrategy.
* @deprecated Since 2.9 Usage of Builder API is preferable
*/
@PluginFactory |
File |
Line |
org/apache/logging/log4j/core/jackson/LogEventJsonMixIn.java |
63 |
org/apache/logging/log4j/core/jackson/LogEventWithContextListMixIn.java |
61 |
@JsonDeserialize(using = ContextDataDeserializer.class)
//@JsonIgnore
@Override
public abstract ReadOnlyStringMap getContextData();
@JsonProperty(JsonConstants.ELT_CONTEXT_STACK)
@JacksonXmlElementWrapper(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_CONTEXT_STACK)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_CONTEXT_STACK_ITEM)
@Override
public abstract ContextStack getContextStack();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract Level getLevel();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract String getLoggerFqcn();
@JsonProperty()
@JacksonXmlProperty(isAttribute = true)
@Override
public abstract String getLoggerName();
@JsonProperty(JsonConstants.ELT_MARKER)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_MARKER)
@Override
public abstract Marker getMarker();
@JsonProperty(JsonConstants.ELT_MESSAGE)
@JsonDeserialize(using = SimpleMessageDeserializer.class) |
File |
Line |
org/apache/logging/log4j/core/jackson/ThrowableProxyMixIn.java |
43 |
org/apache/logging/log4j/core/jackson/ThrowableProxyWithoutStacktraceMixIn.java |
40 |
private ExtendedStackTraceElement[] extendedStackTrace;
@JsonProperty
@JacksonXmlProperty(isAttribute = true)
private String localizedMessage;
@JsonProperty
@JacksonXmlProperty(isAttribute = true)
private String message;
@JsonProperty
@JacksonXmlProperty(isAttribute = true)
private String name;
@JsonIgnore
private transient Throwable throwable;
@JsonIgnore
public abstract String getCauseStackTraceAsString();
@JsonIgnore
public abstract String getExtendedStackTraceAsString();
@JsonIgnore
public abstract StackTraceElement[] getStackTrace();
@JsonProperty(JsonConstants.ELT_SUPPRESSED)
@JacksonXmlElementWrapper(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_SUPPRESSED)
@JacksonXmlProperty(namespace = XmlConstants.XML_NAMESPACE, localName = XmlConstants.ELT_SUPPRESSED_ITEM)
public abstract ThrowableProxy[] getSuppressedProxies();
@JsonIgnore
public abstract String getSuppressedStackTrace();
@JsonIgnore
public abstract Throwable getThrowable();
} |
File |
Line |
org/apache/logging/log4j/core/layout/CsvLogEventLayout.java |
53 |
org/apache/logging/log4j/core/layout/CsvParameterLayout.java |
62 |
public static CsvLogEventLayout createLayout(
// @formatter:off
@PluginConfiguration final Configuration config,
@PluginAttribute(value = "format", defaultString = DEFAULT_FORMAT) final String format,
@PluginAttribute("delimiter") final Character delimiter,
@PluginAttribute("escape") final Character escape,
@PluginAttribute("quote") final Character quote,
@PluginAttribute("quoteMode") final QuoteMode quoteMode,
@PluginAttribute("nullString") final String nullString,
@PluginAttribute("recordSeparator") final String recordSeparator,
@PluginAttribute(value = "charset", defaultString = DEFAULT_CHARSET) final Charset charset,
@PluginAttribute("header") final String header,
@PluginAttribute("footer") final String footer)
// @formatter:on
{
final CSVFormat csvFormat = createFormat(format, delimiter, escape, quote, quoteMode, nullString, recordSeparator);
return new CsvLogEventLayout(config, charset, csvFormat, header, footer); |
File |
Line |
org/apache/logging/log4j/core/config/composite/CompositeConfiguration.java |
84 |
org/apache/logging/log4j/core/config/xml/XmlConfiguration.java |
115 |
statusConfig.withStatus(value.toUpperCase());
} else if ("dest".equalsIgnoreCase(key)) {
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
} else if ("shutdownTimeout".equalsIgnoreCase(key)) {
shutdownTimeoutMillis = Long.parseLong(value);
} else if ("verbose".equalsIgnoreCase(key)) {
statusConfig.withVerbosity(value);
} else if ("packages".equalsIgnoreCase(key)) {
pluginPackages.addAll(Arrays.asList(value.split(Patterns.COMMA_SEPARATOR)));
} else if ("name".equalsIgnoreCase(key)) {
setName(value);
} |
File |
Line |
org/apache/logging/log4j/core/filter/MarkerFilter.java |
45 |
org/apache/logging/log4j/core/filter/NoMarkerFilter.java |
40 |
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final String msg,
final Object... params) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final Object msg,
final Throwable t) {
return filter(marker);
}
@Override
public Result filter(final Logger logger, final Level level, final Marker marker, final Message msg,
final Throwable t) {
return filter(marker);
}
@Override
public Result filter(final LogEvent event) {
return filter(event.getMarker());
} |
File |
Line |
org/apache/logging/log4j/core/message/ExtendedThreadInformation.java |
115 |
org/apache/logging/log4j/core/message/ExtendedThreadInformation.java |
138 |
case WAITING: {
final StackTraceElement element = info.getStackTrace()[0];
final String className = element.getClassName();
final String method = element.getMethodName();
if (className.equals("java.lang.Object") && method.equals("wait")) {
sb.append(" (on object monitor");
if (info.getLockOwnerName() != null) {
sb.append(" owned by \"");
sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
}
sb.append(')');
} else if (className.equals("java.lang.Thread") && method.equals("join")) { |
File |
Line |
org/apache/logging/log4j/core/async/AsyncLoggerConfig.java |
245 |
org/apache/logging/log4j/core/config/LoggerConfig.java |
587 |
additive, properties, config, includeLocation(includeLocation));
}
/**
* Factory method to create a LoggerConfig.
*
* @param additivity True if additive, false otherwise.
* @param level The Level to be associated with the Logger.
* @param loggerName The name of the Logger.
* @param includeLocation "true" if location should be passed downstream
* @param refs An array of Appender names.
* @param properties Properties to pass to the Logger.
* @param config The Configuration.
* @param filter A Filter.
* @return A new LoggerConfig.
* @since 3.0
*/
@PluginFactory
public static LoggerConfig createLogger(
@PluginAttribute(value = "additivity", defaultBoolean = true) final boolean additivity,
@PluginAttribute("level") final Level level,
@Required(message = "Loggers cannot be configured without a name") @PluginAttribute("name") final String loggerName,
@PluginAttribute("includeLocation") final String includeLocation,
@PluginElement("AppenderRef") final AppenderRef[] refs,
@PluginElement("Properties") final Property[] properties,
@PluginConfiguration final Configuration config,
@PluginElement("Filter") final Filter filter) {
final String name = loggerName.equals(ROOT) ? Strings.EMPTY : loggerName;
return new AsyncLoggerConfig(name, Arrays.asList(refs), filter, level, additivity, properties, config, |
File |
Line |
org/apache/logging/log4j/core/config/json/JsonConfiguration.java |
72 |
org/apache/logging/log4j/core/config/xml/XmlConfiguration.java |
111 |
for (final Map.Entry<String, String> entry : rootNode.getAttributes().entrySet()) {
final String key = entry.getKey();
final String value = getConfigurationStrSubstitutor().replace(entry.getValue());
// TODO: this duplicates a lot of the XmlConfiguration constructor
if ("status".equalsIgnoreCase(key)) {
statusConfig.withStatus(value);
} else if ("dest".equalsIgnoreCase(key)) {
statusConfig.withDestination(value);
} else if ("shutdownHook".equalsIgnoreCase(key)) {
isShutdownHookEnabled = !"disable".equalsIgnoreCase(value);
} else if ("shutdownTimeout".equalsIgnoreCase(key)) {
shutdownTimeoutMillis = Long.parseLong(value);
} else if ("verbose".equalsIgnoreCase(entry.getKey())) { |
File |
Line |
org/apache/logging/log4j/core/layout/MarkerPatternSelector.java |
150 |
org/apache/logging/log4j/core/layout/ScriptPatternSelector.java |
172 |
} catch (final RuntimeException ex) {
throw new IllegalArgumentException("Cannot parse pattern '" + property.getPattern() + "'", ex);
}
}
try {
final List<PatternFormatter> list = parser.parse(defaultPattern, alwaysWriteExceptions, disableAnsi,
noConsoleNoAnsi);
defaultFormatters = list.toArray(new PatternFormatter[0]);
this.defaultPattern = defaultPattern;
for (int i = 0; !needsLocation && i < defaultFormatters.length; ++i) {
needsLocation = defaultFormatters[i].requiresLocation();
}
} catch (final RuntimeException ex) {
throw new IllegalArgumentException("Cannot parse pattern '" + defaultPattern + "'", ex);
} |
File |
Line |
org/apache/logging/log4j/core/async/AsyncLoggerConfig.java |
317 |
org/apache/logging/log4j/core/config/LoggerConfig.java |
657 |
@PluginFactory
public static LoggerConfig createLogger(
@PluginAttribute("additivity") final String additivity,
@PluginAttribute("level") final Level level,
@PluginAttribute("includeLocation") final String includeLocation,
@PluginElement("AppenderRef") final AppenderRef[] refs,
@PluginElement("Properties") final Property[] properties,
@PluginConfiguration final Configuration config,
@PluginElement("Filter") final Filter filter) {
final List<AppenderRef> appenderRefs = Arrays.asList(refs);
final Level actualLevel = level == null ? Level.ERROR : level;
final boolean additive = Booleans.parseBoolean(additivity, true);
return new AsyncLoggerConfig(LogManager.ROOT_LOGGER_NAME, appenderRefs, filter, actualLevel, additive, |
File |
Line |
org/apache/logging/log4j/core/util/CronExpression.java |
1364 |
org/apache/logging/log4j/core/util/CronExpression.java |
1455 |
int daysToAdd = 0;
if (cDow < dow) {
daysToAdd = dow - cDow;
}
if (cDow > dow) {
daysToAdd = dow + (7 - cDow);
}
final int lDay = getLastDayOfMonth(mon, cl.get(Calendar.YEAR));
if (day + daysToAdd > lDay) { // did we already miss the
// last one?
cl.set(Calendar.SECOND, 0);
cl.set(Calendar.MINUTE, 0);
cl.set(Calendar.HOUR_OF_DAY, 0);
cl.set(Calendar.DAY_OF_MONTH, 1);
cl.set(Calendar.MONTH, mon);
// no '- 1' here because we are promoting the month
continue;
} |
File |
Line |
org/apache/logging/log4j/core/util/CronExpression.java |
773 |
org/apache/logging/log4j/core/util/CronExpression.java |
799 |
if (i < s.length() && ((c = s.charAt(i)) == '/')) {
i++;
c = s.charAt(i);
final int v2 = Integer.parseInt(String.valueOf(c));
i++;
if (i >= s.length()) {
addToSet(val, end, v2, type);
return i;
}
c = s.charAt(i);
if (c >= '0' && c <= '9') {
final ValueSet vs = getValue(v2, s, i);
final int v3 = vs.value;
addToSet(val, end, v3, type);
i = vs.pos;
return i;
} else { |
File |
Line |
org/apache/logging/log4j/core/appender/AbstractFileAppender.java |
162 |
org/apache/logging/log4j/core/appender/FileAppender.java |
256 |
org/apache/logging/log4j/core/appender/MemoryMappedFileAppender.java |
131 |
org/apache/logging/log4j/core/appender/RandomAccessFileAppender.java |
116 |
final M manager, final String filename, final boolean ignoreExceptions,
final boolean immediateFlush, final Advertiser advertiser, final Property[] properties) {
super(name, layout, filter, ignoreExceptions, immediateFlush, properties, manager);
if (advertiser != null) {
final Map<String, String> configuration = new HashMap<>(layout.getContentFormat());
configuration.putAll(manager.getContentFormat());
configuration.put("contentType", layout.getContentType());
configuration.put("name", name);
advertisement = advertiser.advertise(configuration);
} else { |
File |
Line |
org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java |
575 |
org/apache/logging/log4j/core/appender/rolling/DirectWriteRolloverStrategy.java |
378 |
}
if (compressAction != null && manager.isAttributeViewEnabled()) {
// Propagate posix attribute view to compressed file
// @formatter:off
final Action posixAttributeViewAction = PosixViewAttributeAction.newBuilder()
.withBasePath(compressedName)
.withFollowLinks(false)
.withMaxDepth(1)
.withPathConditions(new PathCondition[0])
.withSubst(getStrSubstitutor())
.withFilePermissions(manager.getFilePermissions())
.withFileOwner(manager.getFileOwner())
.withFileGroup(manager.getFileGroup())
.build();
// @formatter:on
compressAction = new CompositeAction(Arrays.asList(compressAction, posixAttributeViewAction), false);
}
final FileRenameAction renameAction = new FileRenameAction(new File(currentFileName), new File(renameTo), |
File |
Line |
org/apache/logging/log4j/core/appender/RollingFileAppender.java |
124 |
org/apache/logging/log4j/core/appender/RollingRandomAccessFileAppender.java |
97 |
LOGGER.error("RollingFileAppender '{}': No TriggeringPolicy provided.", getName());
return null;
}
if (strategy == null) {
if (fileName != null) {
strategy = DefaultRolloverStrategy.newBuilder()
.withCompressionLevelStr(String.valueOf(Deflater.DEFAULT_COMPRESSION))
.withConfig(getConfiguration())
.build();
} else {
strategy = DirectWriteRolloverStrategy.newBuilder()
.withCompressionLevelStr(String.valueOf(Deflater.DEFAULT_COMPRESSION))
.withConfig(getConfiguration())
.build();
}
} else if (fileName == null && !(strategy instanceof DirectFileRolloverStrategy)) {
LOGGER.error("RollingFileAppender '{}': When no file name is provided a DirectFilenameRolloverStrategy must be configured"); |
File |
Line |
org/apache/logging/log4j/core/message/ExtendedThreadInformation.java |
125 |
org/apache/logging/log4j/core/message/ExtendedThreadInformation.java |
150 |
sb.append(')');
} else if (className.equals("java.lang.Thread") && method.equals("join")) {
sb.append(" (on completion of thread ").append(info.getLockOwnerId()).append(')');
} else {
sb.append(" (parking for lock");
if (info.getLockOwnerName() != null) {
sb.append(" owned by \"");
sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
}
sb.append(')');
}
break;
} |
|