Sorry, I actually thought this way would be simpler. In addition, cleanly 
shutting down is usually a good thing. :-)

I'll look and see if there is a more direct way to force a flush.

Ralph 



On Mar 25, 2013, at 9:41 AM, adischlesinger wrote:

> Thanks! I did not succeed however. I am using a LoggerConfig to which I add
> the appender. I have tried:
> 
>       public void flush() {
>               Configurator.shutdown((LoggerContext)LogManager.getContext());
>       }
> 
> I does not work. I suspect this is incorrect: I get an interface and
> "shutdown" expects an object of the LoggerContext class (which implements
> the interface). Do I have to get to some other LoggerContext object from my
> LoggerContext and RollingFileAppender objects? I don't know how to do this.
> Thanks.
> 
> P.S. I would have expected a straightforward way to do a "flush", I don't
> know why basic functionality is much more obscured compared to 1.x. But this
> may be because the increase in complexity.
> 
> 
> 
> --
> View this message in context: 
> http://apache-logging.6191.n7.nabble.com/Flushing-FileAppender-explicitly-tp36205p36285.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to