Basically I have subclassed the RollingFileAppender logback class in this way :
public class LazyRollingFileAppender<E> extends RollingFileAppender<E> {
/**
* Sets and <i>opens</i> the file where the log output will go. The specified
* file must be writable.
*
* @param file_name
* The path to the log file.
*
* @author Alessio Pollero
*/
@Override
public void openFile(String file_name) throws IOException {
synchronized (lock) {
File file = new File(file_name);
LazyFileOutputStream lazyFos = new LazyFileOutputStream(file, append);
setOutputStream(lazyFos);
}
}
Basically I have subclassed the RollingFileAppender logback class in this way :
public class LazyRollingFileAppender<E> extends RollingFileAppender<E> {
/**
* Sets and <i>opens</i> the file where the log output will go. The specified
* file must be writable.
*
* @param file_name
* The path to the log file.
*
* @author Alessio Pollero
*/
@Override
public void openFile(String file_name) throws IOException {
synchronized (lock) {
File file = new File(file_name);
LazyFileOutputStream lazyFos = new LazyFileOutputStream(file, append);
setOutputStream(lazyFos);
}
}
}
I hope this will helps someone ...