Hi Alessandro,

The simplest way to achieve your goal is to provide a public static method which returns a custom java.io.OutputStream or java.io.Writer. Then point to that method using the system property derby.stream.error.field as described in the Reference Manual: http://db.apache.org/derby/docs/10.11/ref/rrefproper33027.html Your custom OutputStream/Writer can filter and reformat the Derby diagnostics as you wish.

On 2/12/15 2:43 AM, Alessandro Manzoni wrote:
I need to log statements to derby.log. I already put derby.language.logStatementText=true propertiy into derby.properties file, and restarted te network server.
Now derby.log is growing as expected.
I didn't find a way to change the log format, Iwould like to change the date format and log also the name of the user that executed a statement. Then I would like to log only statement that change the db, delete update and insert, and avoid to log sysprocs calls.

Is there some way to achieve my goals?

Further more, even if the server is stopped, I cannot open derby.log file because of an access denied error (it's windows). The only way I found to browse derby.log is from a dos prompt opened as Administrator, so it appear as an authorization problem.
That's not comfortable at all.

Is there a way to have Derby create derby.log with different authorizations?
Maybe someone with more Windows experience can offer some advice here. It sounds as though the server is being run from the Administrator account. You could try running the server from some less restricted account. You might be able to get around this problem by directing derby.log to a less secure part of the file system. See http://db.apache.org/derby/docs/10.11/ref/rrefproper18151.html. Otherwise, you should be able to adjust the permissions on the diagnostic log file if you pursue the derby.stream.error.field approach described above.

Hope this helps,
-Rick




Reply via email to