From 05ed87f66dcfd36c7b2516e4a07f97af77aa5e09 Mon Sep 17 00:00:00 2001 From: jmehrens Date: Sat, 20 Jan 2024 01:13:00 -0600 Subject: [PATCH] MailHandler LogManger support for mail entries #119 Signed-off-by: jmehrens --- doc/src/main/resources/docs/CHANGES.txt | 3 +- .../angus/mail/util/logging/MailHandler.java | 143 ++++++++++++------ .../mail/util/logging/MailHandlerTest.java | 87 +++++++++++ 3 files changed, 185 insertions(+), 48 deletions(-) diff --git a/doc/src/main/resources/docs/CHANGES.txt b/doc/src/main/resources/docs/CHANGES.txt index 943caa5..6caee3c 100644 --- a/doc/src/main/resources/docs/CHANGES.txt +++ b/doc/src/main/resources/docs/CHANGES.txt @@ -14,12 +14,13 @@ The following bugs have been fixed in the 2.0.3 release. 52: CompactFormatter support for LogRecord::getLongThreadID 107: java.io.UnsupportedEncodingException: en_US.iso885915 if charset is "en_US.iso885915" 110: WildFly support for MailHandler +116: MailHandler LogManger support for mail entries CHANGES IN THE 2.0.2 RELEASE ---------------------------- The following bugs have been fixed in the 2.0.2 release. -83: package-info.class major version: 53 +83: package-info.class major version: 53 87: jakarta.mail fails to resolve due to required org.glassfish.hk2.osgiresourcelocator dependency 88: Fix Provide-Capability headers in MANIFEST.MF (required by OSGi service loader). 89: fix default build without -Poss-release diff --git a/mailhandler/src/main/java/org/eclipse/angus/mail/util/logging/MailHandler.java b/mailhandler/src/main/java/org/eclipse/angus/mail/util/logging/MailHandler.java index fbede9e..75d11f4 100644 --- a/mailhandler/src/main/java/org/eclipse/angus/mail/util/logging/MailHandler.java +++ b/mailhandler/src/main/java/org/eclipse/angus/mail/util/logging/MailHandler.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2009, 2023 Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2009, 2023 Jason Mehrens. All rights reserved. + * Copyright (c) 2009, 2024 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2024 Jason Mehrens. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -66,6 +66,7 @@ import java.util.HashMap; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.Properties; import java.util.ResourceBundle; import java.util.logging.ErrorManager; @@ -122,16 +123,16 @@ * com.foo.MyHandler.verify = local * * - * All mail properties documented in the Java Mail API cascade to - * the LogManager by prefixing a key using the fully qualified class name of - * this MailHandler or the fully qualified derived class name dot - * mail property. If the prefixed property is not found, then the mail property - * itself is searched in the LogManager. By default each - * MailHandler is initialized using the following LogManager - * configuration properties where <handler-name> refers to - * the fully qualified class name of the handler. If properties are not - * defined, or contain invalid values, then the specified default values are - * used. + * All mail properties documented in the + * Jakarta Mail API cascade to the LogManager by prefixing a key + * using the fully qualified class name of this MailHandler or the + * fully qualified derived class name dot mail property. If the prefixed + * property is not found, then the mail property itself is searched in the + * LogManager. By default each MailHandler is initialized using the + * following LogManager configuration properties where + * <handler-name> refers to the fully qualified class name of + * the handler. If properties are not defined, or contain invalid values, then + * the specified default values are used. * *