Last active
August 29, 2015 14:16
-
-
Save rufer7/10ee4cf3aa31c5de3b7e to your computer and use it in GitHub Desktop.
Log4j logging examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
public class LogSamples { | |
private static final Logger LOG = LoggerFactory.getLogger(LogSamples.class); | |
public static void main(String args[]){ | |
Object o = new Object; | |
// Sample 1 | |
LOG.debug("Object o: " + o.toString()); | |
// Sample 2 | |
LOG.debug("Object o: {}", o.toString()); | |
// Sample 3 | |
LOG.debug("Object o: %s", o.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment