Skip to content

Instantly share code, notes, and snippets.

@rufer7
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rufer7/10ee4cf3aa31c5de3b7e to your computer and use it in GitHub Desktop.
Save rufer7/10ee4cf3aa31c5de3b7e to your computer and use it in GitHub Desktop.
Log4j logging examples
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