I have several appenders set up, I'm getting one file for one appender, but some appenders might be unused by the system, that's why there are empty log files. But I think you answered my question, it's not possible to set up the appender in the XML config file to create the log file only in case if there's something that needs to be written to it.
----- Original Message ----- From: "Ralph Goers" <[email protected]> To: "log4j-user" <[email protected]> Sent: Wednesday, September 16, 2015 6:01:55 PM Subject: Re: Question - RollingFileAppender creates empty files The files are created as soon as the output stream is opened. This happens when the Appender starts. I’d have to see your configuration to understand why you would be getting multiple files though. Ralph > On Sep 16, 2015, at 7:23 AM, Csilla Fabian <[email protected]> wrote: > > Hello, > > I'm using log4j2 RollingFileAppenders to log events of a complex system. My > problem is that empty log files are created for every appender even if the > given subsystem has nothing to write to them. Is there any way to restrict > the number of files using just the XML configuration file? I could find only > programmatic solutions. > Thank you for the answer. > > Regards, > Csilla Fabian, SDE > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
