-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WildFly support for MailHandler #110
Comments
Created new WildFly module:
MailHandler is unable to see org.eclipse.angus.activation:
I might have to add all resource jars when the module is created. RESOLUTION: This was due to not adding the 4 jars required for the MailHandler in the module add command.
|
Clearing properties uses default values 0 and null:
|
Need to troubleshoot the following:
RESOLUTION: This was due to not setting the CCL during session init. |
Must be a test case that is not covered in the test suite for CompactFormatter:
RESOLUTION: A new ticket needs to be created so the CompactFormatter doesn't call format but instead calls The test case that is missing is: There is another issue where the %s wasn't replaced with the correct file path. I think this is an issue where WildFly is not replacing tokens. The workaround is to allow CompactFormatter to replace the tokens. |
It seems that
Need to test if a pattern formatter can be setup to create a literal subject. RESOLUTION: A named formatter can be used to set the subject on the MailHandler. The CompactFormatter and CollectorFormatter need to be modified. |
WildFly locates setAuthenticator(Authenticator) instead of setAuthenticator(char...) and is unable to set a password string.
RESOLUTION: Created https://issues.redhat.com/browse/LOGMGR-340 TODO: need to test if POJO options can be used in WildFly to create a custom Authenticator and then set the property. |
Comparator can not be created. Therefore must add string argument method with a unique name.
This needs to be a ticket of its own. It would be nice to support a syntax like method references to build comparator chain on the MailHandler and the CollectorFormatter. |
Push filter can't be set either. However, I should be able to create a named filter and assign that.
RESOLUTION: Creating a named filter using jboss-cli allows installing a pushFilter.
I tried adding constructor-properties={records=1000,duration=120000} but this fails as the WildFly still attempts to set normal properties which don't exist. Perhaps this is due to org.jboss.logmanager 2.1.19.Final being used in WildFly? |
WildFly doesn't understand Formatter arrays as method parameters and MailHandler needs to treat null as zero length:
|
WildFly doesn't understand string arrays https://github.com/jboss-logging/jboss-logmanager/blob/main/src/main/java/org/jboss/logmanager/configuration/ObjectBuilder.java#L270
|
Setting the root logger to
In testing setting root logger to Here is an example where main thread (number 1) is blocked by put and the AsyncHandler worker (pool-1-thread-1 number 16) is also blocked by put.
RESOLUTION: Created RedHat issue https://issues.redhat.com/browse/LOGMGR-339 |
MessageFormat tokens are not allowed passed the field validations in the web UI.
This includes This means that there is no way to set the CollectorFormatter pattern. One option would be to allow printf style formats but that will disable choice style formatting. Manually editing the files seems to work. |
Adding an attachment yields:
RESOLUTION: modified the factory methods to set the CCL. |
The AsyncHandler has auto-flush as always on which overrides the cool-down of the MailHandler push filter. There doesn't seem to be a way in the UI or the JBoss-CLI to turn auto-flush off. Might work to manually edit the logging.properties but there is no way to manually edit the standalone.xml to add such a property.
|
Signed-off-by: jmehrens <jason_mehrens@hotmail.com>
WildFly web UI validation doesn't allow for setting |
sometimes using |
@lukasj Thanks for the tip. It looks like that is rejected too: The error message is:
It is not a blocker for this ticket. I've been working around the web UI validation by entering underscore instead of spaces and then just edit the backing logging.properties and standalone.xml to convert them back to spaces. I'll file a RFE against WildFly to consider allowing more characters. On the MailHandler side I'll consider adding a support for a transformer function on the setMailEntries but it will be a future project. RESOLUTION: Use the jbosscli instead of the Web UI. See: https://issues.redhat.com/browse/WFLY-18724 |
Committed as: 76fde65 Final approach was to:
|
The MailHandler only supports setting mail properties through a properties object. Per the WildFly docs: All properties must be accessible via a setter method.
See also:
In order to support WildFly, one option would be to add a new public method that takes a string that is the path to a resource which then loads the properties file. Just need to verify that WildFly allows this. This would be the preferred option as it would be useful for loading the logging.properties as mail properties when using the standard LogManager.
Another option would be to create a new method which takes a string that can be parsed as the contents of properties file. Splitting string key/value pairs where semicolon is used to delimit the entries would be one option assuming that is not used in any other property values. Need to look at:
Final option to consider would be adding property setters for Jakarta Mail API properties and Angus SMTP provider properties.
Things to consider before implementing this change are:
List of properties from API (draft):
List of properties from Angus (draft):
List of properties from MailHandler (draft)
The text was updated successfully, but these errors were encountered: