/**
+ * Determines whether the logfile is rotatable
+ */
+ private boolean rotatable = true;
+
+
+ /**
* The PrintWriter to which we are currently logging, if any.
*/
private volatile PrintWriter writer = null;
writerLock.readLock().lock();
// If the date has changed, switch log files
- if (!date.equals(tsDate)) {
+ if (rotatable && !date.equals(tsDate)) {
// Update to writeLock before we switch
writerLock.readLock().unlock();
writerLock.writeLock().lock();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
// Retrieve configuration of logging file name
+ rotatable = Boolean.parseBoolean(getProperty(className + ".rotatable", "true"));
if (directory == null)
directory = getProperty(className + ".directory", "logs");
if (prefix == null)
writerLock.writeLock().lock();
try {
String pathname = dir.getAbsolutePath() + File.separator +
- prefix + date + suffix;
+ prefix + (rotatable ? date : "") + suffix;
String encoding = getEncoding();
FileOutputStream fos = new FileOutputStream(pathname, true);
OutputStream os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos;