Skip to content
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

slf4j in favour of j.u.l. logging #25

Closed
gmulders opened this issue Feb 4, 2016 · 2 comments
Closed

slf4j in favour of j.u.l. logging #25

gmulders opened this issue Feb 4, 2016 · 2 comments
Milestone

Comments

@gmulders
Copy link
Contributor

gmulders commented Feb 4, 2016

Dalesbred uses java.util.logging for logging. With this issue I'd like to request that it is converted to slf4j or some other thin implementable layer.

The one big advantage of java.util.logging is that it needs no external dependencies. However it is an implementation thus it forces the user of Dalesbred to use that specific logging library. Using the jul-to-slf4j bridge is no real option, since the impact on the performance is huge and the usage is pretty invasive.

Note that enhancement #23 might also open the door for enhanced query logging.

slf4j
Advantages:

  • It's really small.
  • Very common; lots of other libraries use it already so there is a good chance that the library is already on the classpath.
  • Not an implementation; the user of the library can use whatever logging library he or she likes.
  • It's API is nice and consistent (unlike j.u.l.'s ;-))

Disadvantage:

  • It's an extra dependency.

Thin implementable layer
Advantages:

  • No extra dependencies.
  • To be implemented by the user, thus lots of freedom.

Disadvantage:

  • Feels like reinventing the wheel.
@komu
Copy link
Member

komu commented Feb 4, 2016

Yeah, I'm pretty much on the same page with you here. I use slf4j on all my projects and add jul-to-slf4j to bridge the logs. I do think that you overestimate the performance impact though: Dalesbred is pretty light on logging and generally the JDBC-calls will totally dominate the performance profile.

That said, I think I could be persuaded to switch to slf4j. In theory having extra dependencies is an annoyance, but in practice having to add jul-to-slf4j manually is even greater an annoyance. :)

A thin custom layer would actually be non-trivial to implement on top of slf4j because then slf4j would think the logging layer is the originator of log-messages, producing bad method info on logs.

@komu komu modified the milestones: 1.3, 1.2 Feb 4, 2016
gmulders added a commit to gmulders/dalesbred that referenced this issue Feb 4, 2016
komu added a commit that referenced this issue Feb 12, 2016
Replace j.u.l. with slf4j. Fixes issue #25.
komu added a commit that referenced this issue Feb 12, 2016
@komu komu closed this as completed Feb 12, 2016
@komu
Copy link
Member

komu commented Apr 12, 2016

I finally released 1.2.0 with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants