提交 f22a634e authored 作者: Richard Bull's avatar Richard Bull 提交者: Noel Grandin

Timestamps in the trace log follow the format (MM-dd-yyyy HH:mm:ss)

instead of the old format (MM-dd HH:mm:ss). Patch by Richard Bull.
上级 a74a8591
......@@ -21,6 +21,9 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Timestamps in the trace log follow the format (MM-dd-yyyy HH:mm:ss) instead
of the old format (MM-dd HH:mm:ss). Patch by Richard Bull.
</li>
<li>Pull request #125: Improved Oracle compatibility with "truncate" with timestamps and dates.
</li>
<li>Pull request #127: Linked tables now support geometry columns.
......
......@@ -12,6 +12,7 @@ import org.h2.command.CommandInterface;
import org.h2.command.Parser;
import org.h2.command.dml.SetTypes;
import org.h2.message.DbException;
import org.h2.message.Trace;
import org.h2.store.FileLock;
import org.h2.util.MathUtils;
import org.h2.util.New;
......@@ -98,8 +99,11 @@ public class Engine implements SessionFactory {
}
}
if (user == null) {
DbException er = DbException.get(ErrorCode.WRONG_USER_OR_PASSWORD);
database.getTrace(Trace.DATABASE).error(er, "wrong user or password; user: \"" +
ci.getUserName() + "\"");
database.removeSession(null);
throw DbException.get(ErrorCode.WRONG_USER_OR_PASSWORD);
throw er;
}
checkClustering(ci, database);
Session session = database.createSession(user);
......@@ -195,6 +199,12 @@ public class Engine implements SessionFactory {
Integer.MAX_VALUE);
command.executeUpdate();
} catch (DbException e) {
if (e.getErrorCode() == ErrorCode.ADMIN_RIGHTS_REQUIRED){
session.getTrace().error(e, "admin rights required; user: \"" +
ci.getUserName() + "\"");
} else {
session.getTrace().error(e, "");
}
if (!ignoreUnknownSetting) {
session.close();
throw e;
......
......@@ -214,7 +214,7 @@ public class TraceSystem implements TraceWriter {
private synchronized String format(String module, String s) {
if (dateFormat == null) {
dateFormat = new SimpleDateFormat("MM-dd HH:mm:ss ");
dateFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss ");
}
return dateFormat.format(System.currentTimeMillis()) + module + ": " + s;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论