db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Can the derby.log file be suppressed?
Date Sat, 13 Oct 2007 14:37:30 GMT
David Leader <d.leader@bio.gla.ac.uk> writes:

> I'm about to distribute my java app with an embedded derby database,
> but it's really not polite for apps to write unsolicited files to
> disc. Anyway of suppressing the derby.log file?

Hi David,

You could take a look at the derby.stream.error.field property:

http://db.apache.org/derby/docs/10.3/tuning/rtunproper33027.html

If you create a stream object which swallows whatever is passed in to
its write() method and put it in a public static field in the class
MyApp, like this

    public static final OutputStream DEV_NULL = new OutputStream() {
            public void write(int b) { }
        };

then you can suppress the derby.log file by setting
derby.stream.error.field to "MyApp.DEV_NULL".

-- 
Knut Anders

Mime
View raw message