Email logging
This minor release introduces two changes.
Additions into the SchedulerService interface
The interface has now two methods, identical to the previous ones, but with no OffsetDateTime to be provided. By default, the current date and time at UTC is provided to the scheduler service.
Logging customized for emails
Most likely, you will need to log the email you just sent or scheduled, but you would also like to avoid a full
toString of the given email object. For instance, you may want to anonymize an email address, or to ignore custom headers, or to format the sending date and time. Now, you can do it by just providing some custom properties.
Here follows a list of properties you can use with some examples:
spring.mail.logging.enabled=true
spring.mail.logging.strategy.from=PLAIN_TEXT
spring.mail.logging.strategy.replyTo=HIDDEN
spring.mail.logging.strategy.to=FULL_TEXT_FROM_COMMERCIAL_AT,
spring.mail.logging.strategy.cc=HIDDEN
spring.mail.logging.strategy.bcc=HIDDEN
spring.mail.logging.strategy.subject=PLAIN_TEXT
spring.mail.logging.strategy.body=FIRST_DOZEN_THEN_STARS
spring.mail.logging.strategy.attachments=HIDDEN
spring.mail.logging.strategy.encoding=HIDDEN
spring.mail.logging.strategy.locale=HIDDEN
spring.mail.logging.strategy.sentAt=STANDARD_DATE_FORMAT_WITH_ZONE_ID
spring.mail.logging.strategy.receiptTo=HIDDEN
spring.mail.logging.strategy.depositionNotificationTo=HIDDEN
spring.mail.logging.strategy.ignore.customHeaders=true
spring.mail.logging.strategy.ignore.nullAndEmptyCollections=trueAllowed logging strategies are defined in the enum it.ozimov.springboot.mail.logging.LoggingStrategy.
Do not pretend to apply a date-only strategy to an email address, or an email address-only strategy to
a text field. Usage should be straightforward.