提交 c9bc84d0 authored 作者: Thomas Mueller's avatar Thomas Mueller

The feature to log all errors (system properties h2.logAllErrors and…

The feature to log all errors (system properties h2.logAllErrors and h2.logAllErrorsFile) has been removed.
上级 e8343cdd
...@@ -213,19 +213,6 @@ public class SysProperties { ...@@ -213,19 +213,6 @@ public class SysProperties {
*/ */
public static final int LOB_CLIENT_MAX_SIZE_MEMORY = getIntSetting("h2.lobClientMaxSizeMemory", 65536); public static final int LOB_CLIENT_MAX_SIZE_MEMORY = getIntSetting("h2.lobClientMaxSizeMemory", 65536);
/**
* System property <code>h2.logAllErrors</code> (default: false).<br />
* Write stack traces of any kind of error to a file.
*/
public static final boolean LOG_ALL_ERRORS = getBooleanSetting("h2.logAllErrors", false);
/**
* System property <code>h2.logAllErrorsFile</code> (default:
* h2errors.txt).<br />
* File name to log errors.
*/
public static final String LOG_ALL_ERRORS_FILE = getStringSetting("h2.logAllErrorsFile", "h2errors.txt");
/** /**
* System property <code>h2.maxFileRetry</code> (default: 16).<br /> * System property <code>h2.maxFileRetry</code> (default: 16).<br />
* Number of times to retry file delete and rename. in Windows, files can't * Number of times to retry file delete and rename. in Windows, files can't
......
...@@ -6,15 +6,11 @@ ...@@ -6,15 +6,11 @@
*/ */
package org.h2.message; package org.h2.message;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import org.h2.constant.SysProperties;
import org.h2.expression.ParameterInterface; import org.h2.expression.ParameterInterface;
import org.h2.util.IOUtils;
import org.h2.util.StatementBuilder; import org.h2.util.StatementBuilder;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
...@@ -384,20 +380,6 @@ public class TraceObject { ...@@ -384,20 +380,6 @@ public class TraceObject {
*/ */
protected SQLException logAndConvert(Exception ex) { protected SQLException logAndConvert(Exception ex) {
SQLException e = DbException.toSQLException(ex); SQLException e = DbException.toSQLException(ex);
if (SysProperties.LOG_ALL_ERRORS) {
synchronized (TraceObject.class) {
// e.printStackTrace();
try {
Writer writer = IOUtils.getBufferedWriter(IOUtils.openFileOutputStream(SysProperties.LOG_ALL_ERRORS_FILE, true));
PrintWriter p = new PrintWriter(writer);
e.printStackTrace(p);
p.close();
writer.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
if (trace == null) { if (trace == null) {
TraceSystem.traceThrowable(e); TraceSystem.traceThrowable(e);
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论