Try the FailoverAppender.  See 
http://logging.apache.org/log4j/2.x/manual/appenders.html#FailoverAppender.

Ralph

On Oct 9, 2013, at 10:25 AM, Sudharma Puranik <[email protected]> 
wrote:

> Hello,
> 
> I have a special case of logging, that is , whenever I get an Error I would 
> want to log to disk. Kind of a Dump log. The approach I have used so far are,
> 
> 1. extend RollingRandomAccessAppender and RandomAccessManager and create my 
> own write method which will only write to a IO Stream and when error occurs I 
> flush it using ByteBuffer. But the problem is I am not able to get the hook 
> of Exception handling.
> 
> 2 Tried to write my own NIO streaming with different thread. But handling 
> rollover is not managable.
> 
> Could you please suggest me a better approach for this?
> 
> -Sudharma


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to