Thanks Ceki,<br>I used example6 and it works but when loading (as many as possible) logs with Strings<br> I'm getting: " Exception in thread "main" java.lang.OutOfMemoryError: Java heap space ".<br>
I have a loop that simply loads using: rfa.doAppend(someString); about 70 000 times.<br>(the same string over and over again, which is about 3.4KB an XML formatted String)<br>How do I prevent it from getting the above stated Exception.<br>
Thanks<br>Greg. <br><br><br><br><div class="gmail_quote">On Wed, Oct 29, 2008 at 2:07 AM, Ceki Gulcu <span dir="ltr"><listid@qos.ch></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hello Greg,<br>
<br>
Please see<br>
<br>
<a href="http://logback.qos.ch/xref-test/ch/qos/logback/core/rolling/TimeBasedRollingTest.html" target="_blank">http://logback.qos.ch/xref-test/ch/qos/logback/core/rolling/TimeBasedRollingTest.html</a><br>
<br>
for an example. You just need to replace<br>
<br>
RollingFileAppender<Object> rfa = new RollingFileAppender<Object>();<br>
<br>
with<br>
<br>
RollingFileAppender<LoggingEvent> rfa =<br>
new RollingFileAppender<LoggingEvent>();<br>
<br>
and the layout variable should be of type PattenLayout (assuming that's the<br>
layout type you wish to use).<br>
<br>
HTH,<br>
<div><div></div><div class="Wj3C7c"><br>
Greg Flex wrote:<br>
> Hi All,<br>
> Could someone please post a simple example on how to use the<br>
> RollingFileAppender programmatically?<br>
> I'm having problems figuring this out. (and massages such as: No context<br>
> given.... etc.)<br>
> Basically what I'd like to do is set everything in my java program.<br>
> Write to a file but adding stuff like computer's IP address and its name<br>
> etc.<br>
> Most importantly, I'd like to modify the file name itself. Say in the<br>
> format: IP_address_date {yyyy-MM-dd_HH-mm-ss}.log<br>
> Thanks a lot,<br>
> Greg.<br>
><br>
><br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Logback-user mailing list<br>
> Logback-user@qos.ch<br>
> <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
<font color="#888888"><br>
--<br>
Ceki Gülcü<br>
Logback: The reliable, generic, fast and flexible logging framework for Java.<br>
<a href="http://logback.qos.ch" target="_blank">http://logback.qos.ch</a><br>
_______________________________________________<br>
Logback-user mailing list<br>
Logback-user@qos.ch<br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</font></blockquote></div><br>