You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Anon User <pi...@gmail.com> on 2013/07/10 11:52:01 UTC

Derby housekeep function for derby.log

Greetings,

With derby.infolog.append=true set, derby.log will not be delete and
re-create upon stop and start Derby.
Furthermore, once the application is stable, most likely derby would not be
reset for a very long time.

Question: Does Derby provides some kind of housekeep function on derby.log?

Reason being was the worries on derby.log grows too big that will affect
system performance or hang the system, worst case.

Thank you in advance.

Regards,



--
View this message in context: http://apache-database.10148.n7.nabble.com/Derby-housekeep-function-for-derby-log-tp132438.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Derby housekeep function for derby.log

Posted by Anon User <pi...@gmail.com>.
Hi All,

- This is set in derby. properties:
derby.stream.error.method=derbyLogRotation.derbyLogRotation

- Found example on empty log messages online: ( changed the class and
function name to derbyLogRotation )

public class derbyLogRotation
{
  public static java.io.OutputStream derbyLogRotation(){
    return new java.io.OutputStream() {
      public void write(int b) throws IOException {
        // Ignore all log messages
      }
    };
  }
}

Have looked through java.util.logging, java.io.OutputStream, also slf4j.
Understand how they info out the logger, but how does it stream existing
logging from derby.log to new derby.log. 

Intend to implement file rotation on derby.log using log4j -
rollingFileAppender. Any example on how to manage the input to output will
be very much appreciated, thank you. 



--
View this message in context: http://apache-database.10148.n7.nabble.com/Derby-housekeep-function-for-derby-log-tp132438p132559.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Derby housekeep function for derby.log

Posted by Mo Maison <mo...@yahoo.fr>.
Le 10/07/2013 13:03, Knut Anders Hatlen a écrit :
> There has been some talk about replacing Derby's custom logger with
> java.util.logging:
>
> https://issues.apache.org/jira/browse/DERBY-3481
> https://issues.apache.org/jira/browse/DERBY-5007
>
>

slf4j might also be considered, as it seems to be
more and more used by open-source projects,
and is supposed to be framework agnostic.
Bridging to j.u.l may however incur a performance penalty.

M.

Re: Derby housekeep function for derby.log

Posted by Anon User <pi...@gmail.com>.
Thanks Knut and Rick for the prompt reply. 



--
View this message in context: http://apache-database.10148.n7.nabble.com/Derby-housekeep-function-for-derby-log-tp132438p132474.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Re: Derby housekeep function for derby.log

Posted by Rick Hillegas <ri...@oracle.com>.
On 7/10/13 4:03 AM, Knut Anders Hatlen wrote:
> Anon User<pi...@gmail.com>  writes:
>
>> Greetings,
>>
>> With derby.infolog.append=true set, derby.log will not be delete and
>> re-create upon stop and start Derby.
>> Furthermore, once the application is stable, most likely derby would not be
>> reset for a very long time.
>>
>> Question: Does Derby provides some kind of housekeep function on derby.log?
>>
>> Reason being was the worries on derby.log grows too big that will affect
>> system performance or hang the system, worst case.
> Hi,
>
> Derby doesn't currently offer that kind of functionality, I think.
>
> There has been some talk about replacing Derby's custom logger with
> java.util.logging:
>
> https://issues.apache.org/jira/browse/DERBY-3481
> https://issues.apache.org/jira/browse/DERBY-5007
>
> But it hasn't been implemented yet. The logger in java.util.logging
> includes functionality for log file rotation, which would help in the
> scenario you mentioned.
>
As a workaround, you can write or find an off-the-shelf implementation 
of java.io.OutputStream or java.io.Writer, one which rotates log files. 
Then you can point derby.stream.error.method at a public static method 
which materializes the custom logger. For more information, see the 
Reference Guide section on derby.stream.error.method: 
http://db.apache.org/derby/docs/10.10/ref/rrefproper35028.html

Hope this helps,
-Rick

Re: Derby housekeep function for derby.log

Posted by Knut Anders Hatlen <kn...@oracle.com>.
Anon User <pi...@gmail.com> writes:

> Greetings,
>
> With derby.infolog.append=true set, derby.log will not be delete and
> re-create upon stop and start Derby.
> Furthermore, once the application is stable, most likely derby would not be
> reset for a very long time.
>
> Question: Does Derby provides some kind of housekeep function on derby.log?
>
> Reason being was the worries on derby.log grows too big that will affect
> system performance or hang the system, worst case.

Hi,

Derby doesn't currently offer that kind of functionality, I think.

There has been some talk about replacing Derby's custom logger with
java.util.logging:

https://issues.apache.org/jira/browse/DERBY-3481
https://issues.apache.org/jira/browse/DERBY-5007

But it hasn't been implemented yet. The logger in java.util.logging
includes functionality for log file rotation, which would help in the
scenario you mentioned.

-- 
Knut Anders