question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jedis should use SLF4J instead of Java logging

See original GitHub issue

Java Logging in not the industry standard anymore. User should be able to use the logging implementation he wants in order not to end up with several logging configuration files to maintain.

SLF4J provide a facade to the most commons logging formats: log4j, java logging and LogBack.

It also improve performances by having string build when needed Example: java logging

log.fine("Sentinel " + host + ":" + port + " published: " + message + ".");

will always build the string

slf4j

LOG.debug("Sentinel {}:{} published: {}.",host,port,message);

will build the string only if logging level is set to debug.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:3
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
HeartSaVioRcommented, Feb 24, 2016

@PatrickSauts Adding a dependency is what we try to avoid since Jedis claims itself as a lightweight library.

Jedis itself barely leaves log message, so I think you can just add jul-to-slf4j as your dependency and choose underlying logging framework to non jdk14. http://www.slf4j.org/legacy.html#jul-to-slf4j

Please give it a try and share the result. Thanks!

1reaction
marcosnilscommented, Feb 16, 2016

@PatrickSauts we try to keep Jedis as plain as possible regarding external dependencies. If you check the code you’ll realize that Jedis have almost no logging at all, and we decided that we’ll try to keep logging as minimal as possible as pretty much everything can be debugged from the redis logs / monitor commands.

If you check the code you’ll realize that there’s no logging at all, so unless we really have the need to support logging, I don’t think we’ll be addressing this soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why use SLF4J over Log4J for logging in Java? Example
In this Java article, we will learn why using SLF4J is better than using log4j or java.util.logging. It's been a long time, since...
Read more >
SLF4J: 10 Reasons Why You Should Be Using It - Stackify
2. It Supports All the Main Logging Frameworks. SLF4J is just an API, and it knows nothing about the underlying logger that manages...
Read more >
SLF4J Error Codes
SLF4J API is designed to bind with one and only one underlying logging framework at a time. If more than one binding is...
Read more >
How to correctly use SLF4J or switch to java util logging
I am currently developing/maintaining a java/maven library. Previously I was using a-lot of additional libraries, after removing the not ...
Read more >
Introduction to SLF4J - Baeldung
Simple Logging Facade for Java (abbreviated SLF4J) acts as a facade for different logging frameworks (e.g., java.util.logging, logback, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found