Skip to content

Commit a3cf42d

Browse files
committed
Move async support to log4j-async-logger
This moves the main code for `AsyncLogger` and `AsyncLoggerConfig` to `log4j-async-logger`. Further tasks such as proper encapsulation into internal packages and removal of the optional dependency guards, will be performed in a future task.
1 parent b69110b commit a3cf42d

File tree

97 files changed

+94
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+94
-77
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AbstractAsyncExceptionHandler.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AbstractAsyncExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import com.lmax.disruptor.ExceptionHandler;
2020

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLogger.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLogger.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import java.util.List;
2020
import org.apache.logging.log4j.Level;
@@ -24,6 +24,8 @@
2424
import org.apache.logging.log4j.core.Logger;
2525
import org.apache.logging.log4j.core.LoggerContext;
2626
import org.apache.logging.log4j.core.ReusableLogEvent;
27+
import org.apache.logging.log4j.core.async.AsyncQueueFullMessageUtil;
28+
import org.apache.logging.log4j.core.async.EventRoute;
2729
import org.apache.logging.log4j.core.config.Configuration;
2830
import org.apache.logging.log4j.core.config.LoggerConfig;
2931
import org.apache.logging.log4j.core.config.Property;

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import java.util.List;
2020
import java.util.concurrent.TimeUnit;
@@ -23,6 +23,8 @@
2323
import org.apache.logging.log4j.LogManager;
2424
import org.apache.logging.log4j.core.Filter;
2525
import org.apache.logging.log4j.core.LogEvent;
26+
import org.apache.logging.log4j.core.async.AsyncQueueFullMessageUtil;
27+
import org.apache.logging.log4j.core.async.EventRoute;
2628
import org.apache.logging.log4j.core.config.AppenderRef;
2729
import org.apache.logging.log4j.core.config.Configuration;
2830
import org.apache.logging.log4j.core.config.LoggerConfig;

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDefaultExceptionHandler.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerConfigDefaultExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
/**
2020
* Default disruptor exception handler for errors that occur in the AsyncLogger background thread.

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDelegate.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerConfigDelegate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import org.apache.logging.log4j.Level;
2020
import org.apache.logging.log4j.core.LogEvent;
21+
import org.apache.logging.log4j.core.async.EventRoute;
2122
import org.apache.logging.log4j.core.impl.LogEventFactory;
2223

2324
/**

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerConfigDisruptor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import com.lmax.disruptor.EventFactory;
2020
import com.lmax.disruptor.EventHandler;
@@ -34,6 +34,11 @@
3434
import org.apache.logging.log4j.core.AbstractLifeCycle;
3535
import org.apache.logging.log4j.core.LogEvent;
3636
import org.apache.logging.log4j.core.ReusableLogEvent;
37+
import org.apache.logging.log4j.core.async.AsyncQueueFullPolicy;
38+
import org.apache.logging.log4j.core.async.AsyncQueueFullPolicyFactory;
39+
import org.apache.logging.log4j.core.async.DiscardingAsyncQueueFullPolicy;
40+
import org.apache.logging.log4j.core.async.EventRoute;
41+
import org.apache.logging.log4j.core.async.InternalAsyncUtil;
3742
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
3843
import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
3944
import org.apache.logging.log4j.core.impl.LogEventFactory;

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContext.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import java.net.URI;
2020
import java.util.concurrent.TimeUnit;

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerContextSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import java.net.URI;
2020
import org.apache.logging.log4j.core.LoggerContext;

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerDefaultExceptionHandler.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerDefaultExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
/**
2020
* Default disruptor exception handler for errors that occur in the AsyncLogger background thread.

log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerDisruptor.java renamed to log4j-async-logger/src/main/java/org/apache/logging/log4j/async/logger/AsyncLoggerDisruptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.logging.log4j.core.async;
17+
package org.apache.logging.log4j.async.logger;
1818

1919
import com.lmax.disruptor.ExceptionHandler;
2020
import com.lmax.disruptor.RingBuffer;
@@ -30,6 +30,10 @@
3030
import java.util.function.Supplier;
3131
import org.apache.logging.log4j.Level;
3232
import org.apache.logging.log4j.core.AbstractLifeCycle;
33+
import org.apache.logging.log4j.core.async.AsyncQueueFullPolicy;
34+
import org.apache.logging.log4j.core.async.AsyncQueueFullPolicyFactory;
35+
import org.apache.logging.log4j.core.async.DiscardingAsyncQueueFullPolicy;
36+
import org.apache.logging.log4j.core.async.EventRoute;
3337
import org.apache.logging.log4j.core.impl.Log4jPropertyKey;
3438
import org.apache.logging.log4j.core.util.Log4jThread;
3539
import org.apache.logging.log4j.core.util.Log4jThreadFactory;

0 commit comments

Comments
 (0)