[
https://issues.apache.org/jira/browse/DERBY-3388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571385#action_12571385
]
Knut Anders Hatlen commented on DERBY-3388:
-------------------------------------------
The patch basically looks good. A couple of small questions/comments:
1) You didn't say, but I assume these properties will be added to the user
documentation?
2) String.toLowerCase() is locale dependent, so this code may not work in all
locales:
+ private static final boolean LOG_REPLICATION_MESSAGES =
+ (PropertyUtil.getSystemProperty(Property.REPLICATION_VERBOSE) != null &&
+ PropertyUtil.getSystemProperty(Property.REPLICATION_VERBOSE).
+ toLowerCase().equals("false"))
+ ? false
+ : true;
It's better to use PropertyUtil.getSystemBoolean().
3) The code mentioned in (2) will read the property when the class is loaded.
Couldn't that mean that it is read before the driver is loaded, so that code
like this would not always behave correctly:
System.setProperty("derby.replication.verbose", "true");
Class.forName("...EmbeddedDriver").forName();
4) Nit: I think it's better to give Monitor.logTextMessage() the date object,
rather than a string representation returned by "new Date().toString()".
toString() will localize the date according to the JVM's locale, I think,
whereas it will be localized together with the message according to the
database's locale if the Date object is passed unmodified to logTextMessage().
(Monitor.logTextMessage() does take an Object argument)
5) It's probably better to use PropertyUtil.getSystemInt() than
getSystemProperty() + parseInt().
6) Should the intervals and the buffer size be database properties so that
you can make them persistent?
> Improve message handling for replication messages to derby.log
> --------------------------------------------------------------
>
> Key: DERBY-3388
> URL: https://issues.apache.org/jira/browse/DERBY-3388
> Project: Derby
> Issue Type: Improvement
> Components: Replication
> Affects Versions: 10.4.0.0
> Reporter: Jørgen Løland
> Assignee: Jørgen Løland
> Priority: Minor
> Attachments: derby-3388-tstamp-and-properties-1a.diff,
> derby-3388-tstamp-and-properties-1a.stat
>
>
> The asynchronous replication functionality writes information to the derby
> log. It would be good to improve this in the following ways:
> 1: startSlave and stopSlave stack traces are written twice to the log - one
> is obviously enough :)
> 2: It should be possible to configure if replication messages written to the
> log should be followed by a stack trace of the cause.
> 3: logged messages should have a timestamp
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.