log4j.properties
log4j.rootLogger=FINE, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c:%L - %m%n
log4j.category.my.root.package=FINEST
My Class
public class MyClass {
private static final Logger logger = Logger.getLogger(MyClass.class.getName());
public boolean download(String destinationPath) {
HttpURLConnection con = null;
int i;
try {
logger.log(Level.FINE, "Download URL {0}", new Object[] { url.toString()});
con = (HttpURLConnection) url.openConnection();
con.setInstanceFollowRedirects(true);
InputStream is = con.getInputStream();
....
Despite my breakpoint reaching the url.openConnection();
line, the Level.FINE
doesn't show up in my console. Here's the console I do see:
INFO: Order: #298596(Status: 1)
15:00:58,532 DEBUG main org.hibernate.engine.transaction.spi.AbstractTransactionImpl:158 - begin
15:00:58,532 DEBUG main org.hibernate.engine.jdbc.internal.LogicalConnectionImpl:295 - Obtaining JDBC connection
15:00:58,558 DEBUG main org.hibernate.engine.jdbc.internal.LogicalConnectionImpl:301 - Obtained JDBC connection
15:00:58,559 DEBUG main org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction:69 - initial autocommit status: true
15:00:58,559 DEBUG main org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction:71 - disabling autocommit
15:00:58,615 DEBUG main org.hibernate.SQL:104 - MY-QUERY
15:00:58,657 DEBUG main org.hibernate.engine.transaction.spi.AbstractTransactionImpl:173 - committing
15:00:58,661 DEBUG main org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction:113 - committed JDBC Connection
15:00:58,661 DEBUG main org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction:126 - re-enabling autocommit
15:00:58,664 DEBUG main org.hibernate.engine.jdbc.internal.LogicalConnectionImpl:314 - Releasing JDBC connection
15:00:58,664 DEBUG main org.hibernate.engine.jdbc.internal.LogicalConnectionImpl:332 - Released JDBC connection
15:00:58,664 DEBUG main org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler:219 - HHH000163: Logical connection releasing its physical connection
INFO: #298596: Importing...
How come I'm not seeing my own custom logging?
Changing log4j.rootLogger=FINE, stdout
to log4j.rootLogger=INFO, stdout
does hide all DEBUG
from the console, so I know this file is being parsed.