Revision 2663
Added by sgarg over 18 years ago
EventLog.java | ||
---|---|---|
29 | 29 |
import java.sql.Timestamp; |
30 | 30 |
import java.util.Date; |
31 | 31 |
|
32 |
import org.apache.log4j.Logger; |
|
33 |
|
|
32 | 34 |
/** |
33 | 35 |
* EventLog is used to intialize and store a log of events that occur in an |
34 | 36 |
* application. The events are registered with the logger as they occur, but |
... | ... | |
57 | 59 |
* The single instance of the event log that is always returned. |
58 | 60 |
*/ |
59 | 61 |
private static EventLog self = null; |
62 |
private Logger logMetacat = Logger.getLogger(EventLog.class); |
|
60 | 63 |
|
61 | 64 |
/** |
62 | 65 |
* A private constructor that initializes the class when getInstance() is |
... | ... | |
128 | 131 |
stmt.executeUpdate(); |
129 | 132 |
stmt.close(); |
130 | 133 |
} catch (SQLException e) { |
131 |
MetaCatUtil.debugMessage("Error while logging event to database: "
|
|
132 |
+ e.getMessage(), 5);
|
|
134 |
logMetacat.error("Error while logging event to database: "
|
|
135 |
+ e.getMessage()); |
|
133 | 136 |
} finally { |
134 | 137 |
// Return database connection to the pool |
135 | 138 |
DBConnectionPool.returnDBConnection(dbConn, serialNumber); |
... | ... | |
230 | 233 |
resultDoc.append("</log>"); |
231 | 234 |
stmt.close(); |
232 | 235 |
} catch (SQLException e) { |
233 |
MetaCatUtil.debugMessage("Error while logging event to database: "
|
|
234 |
+ e.getMessage(), 5);
|
|
236 |
logMetacat.info("Error while logging event to database: "
|
|
237 |
+ e.getMessage()); |
|
235 | 238 |
} finally { |
236 | 239 |
// Return database connection to the pool |
237 | 240 |
DBConnectionPool.returnDBConnection(dbConn, serialNumber); |
Also available in: Unified diff
Replacing MetaCatUtil.debugMessage or MetaCatUtil.logMetacat call with logMetacat (private Logger object) call