You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2024/03/28 15:55:19 UTC

[PR] Remove `o.a.l.l.c.a.r.a.Duration` class (logging-log4j2)

ppkarwasz opened a new pull request, #2426:
URL: https://github.com/apache/logging-log4j2/pull/2426

   This is the 3.x counterpart of the `o.a.l.l.c.a.r.a.Duration` deprecation in #2425.
   
   It also makes the `Clock` argument for the `IfLastModified` plugin compulsory. The argument is usually supplied by injection.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove `o.a.l.l.c.a.r.a.Duration` class (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on code in PR #2426:
URL: https://github.com/apache/logging-log4j2/pull/2426#discussion_r1544583487


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java:
##########
@@ -97,17 +91,24 @@ public String toString() {
         return "IfLastModified(age=" + age + nested + ")";
     }
 
+    /**
+     * @since 2.24.0
+     */
     @PluginFactory
     public static Builder newBuilder() {
         return new Builder();
     }
 
-    public static class Builder implements Supplier<IfLastModified> {
+    /**
+     * @since 2.24.0
+     */
+    public static final class Builder implements Supplier<IfLastModified> {
         private Duration age;
         private PathCondition[] nestedConditions;
         private Clock clock;
 
-        public Builder setAge(@PluginAttribute final Duration age) {
+        public Builder setAge(
+                @PluginAttribute @Required(message = "No age provided for IfLastModified") final Duration age) {

Review Comment:
   The default message is somehow generic: `The parameter is null or empty: age`.
   
   The message I added is the same as in `2.x`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove `o.a.l.l.c.a.r.a.Duration` class (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz merged PR #2426:
URL: https://github.com/apache/logging-log4j2/pull/2426


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove `o.a.l.l.c.a.r.a.Duration` class (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on code in PR #2426:
URL: https://github.com/apache/logging-log4j2/pull/2426#discussion_r1543719114


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/IfLastModified.java:
##########
@@ -97,17 +91,24 @@ public String toString() {
         return "IfLastModified(age=" + age + nested + ")";
     }
 
+    /**
+     * @since 2.24.0
+     */
     @PluginFactory
     public static Builder newBuilder() {
         return new Builder();
     }
 
-    public static class Builder implements Supplier<IfLastModified> {
+    /**
+     * @since 2.24.0
+     */
+    public static final class Builder implements Supplier<IfLastModified> {
         private Duration age;
         private PathCondition[] nestedConditions;
         private Clock clock;
 
-        public Builder setAge(@PluginAttribute final Duration age) {
+        public Builder setAge(
+                @PluginAttribute @Required(message = "No age provided for IfLastModified") final Duration age) {

Review Comment:
   Is this `message` really needed? I think the DI should be smart enough to generate that, right? Doesn't it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org