[Jukebox-cvs] CVS update: J4/src/java/gnu/j4/core BasicSyslog.java
Brought to you by:
vtt
From: CVS B. <vt...@fr...> - 2000-08-24 20:35:33
|
User: vt Date: 00/08/24 13:35:50 Modified: src/java/gnu/j4/core BasicSyslog.java Log: Patchlevel bump. - Incorporated changes made in the JAXP branch - Added the local configuration options support Revision Changes Path 1.16 +42 -1 J4/src/java/gnu/j4/core/BasicSyslog.java CVSWEB Options: ------------------- CVSWeb: Annotate this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/core/BasicSyslog.java?annotate=1.16&cvsroot=jukebox4 CVSWeb: View this file: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/core/BasicSyslog.java?rev=1.16&content-type=text/x-cvsweb-markup&cvsroot=jukebox4 CVSWeb: Diff to previous version: http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/J4/src/java/gnu/j4/core/BasicSyslog.java.diff?r1=1.16&r2=1.15&cvsroot=jukebox4 ----------------------------------- Index: BasicSyslog.java =================================================================== RCS file: /usr/local/cvs/J4/src/java/gnu/j4/core/BasicSyslog.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- BasicSyslog.java 2000/07/17 02:14:25 1.15 +++ BasicSyslog.java 2000/08/24 20:35:50 1.16 @@ -43,7 +43,7 @@ * something less complicated, at least for the production versions. * @author Copyright © <a href="mailto:vt...@fr...">Vadim Tkachenko</a> 1995-1998 - * @version $Id: BasicSyslog.java,v 1.15 2000/07/17 02:14:25 vt Exp $ + * @version $Id: BasicSyslog.java,v 1.16 2000/08/24 20:35:50 vt Exp $ * @since Jukebox v4 * @see LogConfigKeywords */ @@ -117,6 +117,47 @@ public void configurationChanged() { dateFormatter = new SimpleDateFormat(conf.getString(DATEFORMAT_CF, DEFAULT_DATEFORMAT)); + + // We know it's possible to make typos in the configuration. To + // ensure the date format is right, I'll try to format the date + // here, because this is the least expensive place to do it. + + try { + + dateFormatter.format(new Date(System.currentTimeMillis())); + + } catch ( Throwable t ) { + + // OK, we're not OK. + // + // Let's just get the default format and pray it works fine. + // Otherwise, we're screwed. + + dateFormatter = new SimpleDateFormat(DEFAULT_DATEFORMAT); + + // And don't forget to complain. The logging system may be + // inoperable at this point, so let's take care of that as well. + + String message = "syslog.timestamp.format (" + + conf.getString(DATEFORMAT_CF) + + ") is invalid (" + + t.getMessage() + + "), using default (" + + DEFAULT_DATEFORMAT + + ")"; + try { + + logMessage(new LogRecord(Thread.currentThread(), + this, LOG_WARNING, Logger.LOG_LOGGER, + message, + null)); + + } catch ( NullPointerException npex ) { + + System.err.println("WARNING: " + message); + } + + } Class filterClass = null; |