Hi,
I am dynamically setting the File name that log4j is logging to with the
FileAppender. However , to do this I am first setting the file to "nul" and
then in script setting it to the real log name. This works fine in Windows
but when run on Unix it actually creates a file called "nul". I can remove
it with a shell script but I would prefer to not have to do that. Here is my
code and is there a better way to do this ?
log4j.properties
log4j.appender.LOGFILE.File=nul
Code
// Set log file name
FileAppender appender = (FileAppender)logger.getAppender("LOGFILE");
appender.setFile(Filename.generateTimestampFilename(logFolderPath,
strLogFileName, ".log"));
appender.activateOptions();
Second , is there a way to dynamically turn off the FileAppender ?
Thanks In Advance
--
View this message in context:
http://www.nabble.com/Dynamic-File-Name-and-Turn-off-File-Logging-tp23635686p23635686.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]