Source code: konspire/common/log/SharedDatedFileLoggingMechanism.java
1 package konspire.common.log;
2
3 /**
4 * This logging mechanism adds today's date to the shared log file name, and also
5 * rolls logging over to a new file when dates change (the first new string
6 * logged on a new date causes the current log file to close and a new log
7 * file to be opened with today's date).
8 *
9 * @author Todd Lauinger
10 * @version $Revision: 1.3 $
11 */
12 public class SharedDatedFileLoggingMechanism extends SharedFileLoggingMechanism {
13
14 // Make the singleton variable be a class instance variable
15 // by overriding its definition in this subclass.
16 protected static SharedDatedFileLoggingMechanism singleton =
17 new SharedDatedFileLoggingMechanism();
18
19 //
20 // Class instance accessor which answers the singleton instance of the
21 // concrete subclass.
22 //
23 public static AbstractLoggingMechanism getInstance() {
24
25 return singleton;
26 }
27
28 // This is a dated log and needs to have a date appended to the
29 // file name and must be rolled over when the current date changes.
30 protected boolean isDatedLog() {
31 return true;
32 }
33
34 }
35