i have created a singleton logger to use in my java application. all the statements before the connection to hsql standalone database are working fine i.e the messages are getting logged. but the logging statements after the conneciton to database are not getting logged. if i remove the connection statement or if the connection to database is failed then the statements after that connection statement are working normally.
why was this happening ??
ORLogger.getLogger().log(Level.INFO, "Trying to connect databse . . .");
Class.forName("org.hsqldb.jdbc.JDBCDriver").newInstance();
ORLogger.getLogger().log(Level.INFO, "HSQL driver loaded . . .");
dbConnection = DriverManager.getConnection("jdbc:hsqldb:file:db/db", "username", "password");
ORLogger.getLogger().log(Level.INFO, "Connected to databse.");
In log file, the log messages are up to the below statement
HSQL driver loaded . . .
But, after that, there is no log messages are added in log file. if remove the connection statement, i.e
dbConnection = DriverManager.getConnection("jdbc:hsqldb:file:db/db", "username", "password");
all messages after the above connection statement are working well.
There is no problem with the connection to database. all the database related work is fine. except this logging is not working properly.