I was thinking more along the lines of an attribute named “deferCreate”.
Ralph > On Sep 17, 2015, at 7:49 AM, Gary Gregory <[email protected]> wrote: > > You could provide a patch that either: > > - Deletes empty files on Log4j shutdown. Would this be an option or always > happen? > - Creates files on-demand. Would this be an option or always happen? > > Gary > > On Wed, Sep 16, 2015 at 11:49 PM, Csilla Fabian <[email protected]> > wrote: > >> >> 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] >> >> > > > -- > E-Mail: [email protected] | [email protected] > Java Persistence with Hibernate, Second Edition > <http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
