Comments (6)
Please reconsider adding a dependency on a concrete slf4j implementation. In my opinion, libraries better depend only on the api alone (and all the ones I know do so, I can provide examples if you want).
The current approach only works without configuration when the user:
- has no binding to an implementation (and is fine with the defaults of log4j2)
- is already using the same version of log4j2, in which case it doesn't help
In all other scenarios it introduces version or binding conflicts and users have to hunt down the reason.
If there is no binding to an implementation, slf4j will print a warning. If users want logging output, they should know what concrete logging system they are using and how to configure it.
from simple-java-mail.
@zimmi I was thinking of providing documentation to exclude the log4j2 implementation from the maven dependencies so you can switch to another.
The API that is used in the code already is that of SLF4J.
However, if using the basic SLF4J implementation logging requires no further configuration from the user if they want to switch implementation, that would be preferable. I only included some implementation so that the demo and test classes produce output.
from simple-java-mail.
What do you think about instead providing documentation to add log4j2 as the recommended modern logging implementation?
Adding a link to the slf4j manual for the demo code for users that want logging output might be enough, maybe.
from simple-java-mail.
I added it as an optional dependency using the maven <scope>optional</scope>
. This way it is included during development, but won't be used by depending projects.
from simple-java-mail.
I also moved the log4j config file to the test resources folder now so that won't be packaged either (see #45).
from simple-java-mail.
I agree with that decision. :)
From a user standpoint, I just want to send mail. The fewer dependencies and assumptions a library makes, the better. Opinions are for frameworks.
Thanks again for your work!
from simple-java-mail.
Related Issues (20)
- Make S/MIME algorithms configurable (signature algorithm for signing, key encapsulation and cipher algorithms for encryption) HOT 4
- [Enhancement] Expose finer-grained DKIM configuration through the builder api and disable 'l-param' by default HOT 12
- [bug] Fix parsing addresses from headers in EML files, like a Disposition-Notification-To with umlaut HOT 1
- Update outlook-message-parser dependency, which has improved support for X500 addresses
- [Bug] Message headers not treated with case insensitivity as per RFC, causing deviating headers to slip through the filters HOT 1
- Maxing out SMTP server concurrent connections HOT 1
- outlookMsgToEmail duplicates recipients if same name used for To and Cc HOT 1
- java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_c13123e/Offline HOT 2
- [security] Update 3rd party dependencies to get rid of all currently known CVE issues HOT 2
- [enhancement+bug] Make EmailConverter API more consistent regarding Session parameter, don't use `Session.getDefaultInstance` anymore and fix bug where `emlToEmailBuilder` used `emlToMimeMessage` HOT 3
- How to create jakarta.mail.internet.MimeMessage without accessing the mailer session? HOT 3
- Update upstream dependency generic-object-pool, which solves a critical bug when there are exceptions during allocation HOT 1
- How to esclude embedded image in email HOT 2
- When reading .msg files the RTF converted to HTML is garbled in some cases where the appropriate charset is not detected properly HOT 6
- Bump smtp-connection-pool from 2.3.2 to 2.3.3 which improves performance and fixes a rare ConcurrentModificationException HOT 1
- [Bug] After converting Outlook .msg to EML, bullet lists have duplicate numbering HTML converted from RTF HOT 3
- Wrong sent date when parsing mail HOT 3
- [bug] error deallocating object already removed from the pool HOT 6
- Trying to add a application/x-xz; charset=binary (tar.xz) attachment ... HOT 12
- Unable to parse .msg file - Block 20736 not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-java-mail.