[minor](log) print error msg to fe.out before log is initialized (#22106)

The exception may be thrown before LOG is initialized.
Such as wrong config value. So we need to print it to fe.out, otherwise
we can't know what's wrong.

After this PR, the error can be found in fe.out, such as:

```
java.lang.NumberFormatException: For input string: "3g"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Long.parseLong(Long.java:589)
        at java.lang.Long.parseLong(Long.java:631)
        at org.apache.doris.common.ConfigBase.setConfigField(ConfigBase.java:253)
        at org.apache.doris.common.ConfigBase.setFields(ConfigBase.java:232)
        at org.apache.doris.common.ConfigBase.initConf(ConfigBase.java:146)
        at org.apache.doris.common.ConfigBase.init(ConfigBase.java:112)
        at org.apache.doris.DorisFE.start(DorisFE.java:101)
        at org.apache.doris.DorisFE.main(DorisFE.java:73)
```
This commit is contained in:
Mingyu Chen
2023-07-23 19:20:10 +08:00
committed by GitHub
parent ddd7e9871d
commit a5099a2d3b

View File

@ -187,6 +187,9 @@ public class DorisFE {
Thread.sleep(2000);
}
} catch (Throwable e) {
// Some exception may thrown before LOG is inited.
// So need to print to stdout
e.printStackTrace();
LOG.warn("", e);
}
}