Revision 2591
Added by sgarg over 19 years ago
src/edu/ucsb/nceas/metacat/MetaCatUtil.java | ||
---|---|---|
35 | 35 |
import java.util.Vector; |
36 | 36 |
import java.util.regex.PatternSyntaxException; |
37 | 37 |
|
38 |
import org.apache.log4j.Logger; |
|
39 |
import org.apache.log4j.PropertyConfigurator; |
|
40 |
|
|
38 | 41 |
import edu.ucsb.nceas.dbadapter.AbstractDatabase; |
39 | 42 |
import edu.ucsb.nceas.utilities.Options; |
40 | 43 |
|
... | ... | |
60 | 63 |
|
61 | 64 |
private static String[] deniedSubmitters; |
62 | 65 |
|
66 |
public static Logger logMetacat = null; |
|
67 |
|
|
63 | 68 |
static { |
64 |
// Determine our db adapter class and create an instance of that class |
|
69 |
|
|
70 |
MetaCatUtil.logMetacat = Logger.getLogger("Metacat"); |
|
71 |
PropertyConfigurator.configure(MetaCatServlet.LOG_CONFIG_NAME); |
|
72 |
|
|
73 |
// Determine our db adapter class and create an instance of that class |
|
65 | 74 |
try { |
66 | 75 |
dbAdapter = (AbstractDatabase) createObject(getOption("dbAdapter")); |
67 | 76 |
} catch (Exception e) { |
... | ... | |
110 | 119 |
return value; |
111 | 120 |
} |
112 | 121 |
|
122 |
|
|
123 |
public static Logger getLog() { |
|
124 |
return logMetacat; |
|
125 |
} |
|
126 |
|
|
113 | 127 |
/** |
114 | 128 |
* Utility method to set an option value from the properties file |
115 | 129 |
* |
Also available in: Unified diff
Added support for log4j to MetaCatUtil so that it can be used by Metacat code for logging.