-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[opt](log) refine the FE logger #35679
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
|
|
run buildall |
TPC-H: Total hot run time: 41258 ms
|
TPC-DS: Total hot run time: 168703 ms
|
ClickBench: Total hot run time: 30.74 s
|
run buildall |
TPC-H: Total hot run time: 41472 ms
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
TPC-DS: Total hot run time: 170015 ms
|
ClickBench: Total hot run time: 30.7 s
|
## Backgroup Previously, FE logs were written to files. The main FE logs include fe.log, fe.warn.log, fe.audit.log, fe.out, and fe.gc.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. ## Solution This PR made the following changes: 1. Modified the log4j configuration template - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, all logs are output to standard output and marked with different prefixes: - `StdoutLogger`: logs for standard output - `StderrLogger`: logs for standard error output - `RuntimeLogger`: logs for fe.log or fe.warn.log - `AuditLogger:` logs for fe.audit.log - No prefix: logs for fe.gc.log Examples are as follows: ``` RuntimeLogger 2024-06-03 14:54:51,229 INFO (binlog-gcer|62) [BinlogManager.gc():359] begin gc binlog ``` 2. Added a new FE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. 3. Optimized the log format of standard output The byte streams of stdout and stderr are captured. The logs previously outputted using `System.out` will be captured in fe.log for unified management.
Previously, FE logs were written to files. The main FE logs include fe.log, fe.warn.log, fe.audit.log, fe.out, and fe.gc.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. This PR made the following changes: 1. Modified the log4j configuration template - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, all logs are output to standard output and marked with different prefixes: - `StdoutLogger`: logs for standard output - `StderrLogger`: logs for standard error output - `RuntimeLogger`: logs for fe.log or fe.warn.log - `AuditLogger:` logs for fe.audit.log - No prefix: logs for fe.gc.log Examples are as follows: ``` RuntimeLogger 2024-06-03 14:54:51,229 INFO (binlog-gcer|62) [BinlogManager.gc():359] begin gc binlog ``` 2. Added a new FE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. 3. Optimized the log format of standard output The byte streams of stdout and stderr are captured. The logs previously outputted using `System.out` will be captured in fe.log for unified management.
## Backgroup Previously, FE logs were written to files. The main FE logs include fe.log, fe.warn.log, fe.audit.log, fe.out, and fe.gc.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. ## Solution This PR made the following changes: 1. Modified the log4j configuration template - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, all logs are output to standard output and marked with different prefixes: - `StdoutLogger`: logs for standard output - `StderrLogger`: logs for standard error output - `RuntimeLogger`: logs for fe.log or fe.warn.log - `AuditLogger:` logs for fe.audit.log - No prefix: logs for fe.gc.log Examples are as follows: ``` RuntimeLogger 2024-06-03 14:54:51,229 INFO (binlog-gcer|62) [BinlogManager.gc():359] begin gc binlog ``` 2. Added a new FE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. 3. Optimized the log format of standard output The byte streams of stdout and stderr are captured. The logs previously outputted using `System.out` will be captured in fe.log for unified management.
Followup #35679 ## Background Previously, BE logs were written to files. The main FE logs include be.INFO, be.WARNING, be.out, be.gc.log and jni.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. ## Solution This PR made the following changes: 1. Modified the glog config: - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, be.INFO's log is output to standard output and marked with prefix `RuntimeLogger`. Examples are as follows: ``` RuntimeLogger I20240605 23:41:20.426553 4137369 runtime_query_statistics_mgr.cpp:245] Report profile thread stopped ``` 2. Added a new BE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. ## TODO - Need to handle jni.log in next PR
Followup apache#35679 Previously, BE logs were written to files. The main FE logs include be.INFO, be.WARNING, be.out, be.gc.log and jni.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. This PR made the following changes: 1. Modified the glog config: - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, be.INFO's log is output to standard output and marked with prefix `RuntimeLogger`. Examples are as follows: ``` RuntimeLogger I20240605 23:41:20.426553 4137369 runtime_query_statistics_mgr.cpp:245] Report profile thread stopped ``` 2. Added a new BE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. - Need to handle jni.log in next PR
Followup #35679 ## Background Previously, BE logs were written to files. The main FE logs include be.INFO, be.WARNING, be.out, be.gc.log and jni.log. In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream. ## Solution This PR made the following changes: 1. Modified the glog config: - When started with `--daemon`, logs are still written to various files, and the format remains unchanged. - When started with `--console`, be.INFO's log is output to standard output and marked with prefix `RuntimeLogger`. Examples are as follows: ``` RuntimeLogger I20240605 23:41:20.426553 4137369 runtime_query_statistics_mgr.cpp:245] Report profile thread stopped ``` 2. Added a new BE config: `enable_file_logger` Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is `false`, the log will not be recorded in the file regardless of the startup method. ## TODO - Need to handle jni.log in next PR
@@ -105,8 +105,7 @@ public void setup(File envHome, String selfNodeName, String selfNodeHostPort, | |||
DbResetRepGroup resetUtility = new DbResetRepGroup( | |||
envHome, PALO_JOURNAL_GROUP, selfNodeName, selfNodeHostPort); | |||
resetUtility.reset(); | |||
LOG.warn("WARNING: metadata recovery mode, group has been reset."); | |||
System.out.println("WARNING: metadata recovery mode, group has been reset."); | |||
LOG.warn("metadata recovery mode, group has been reset."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Printing this type of log to stdout is critical for troubleshooting.
@@ -446,8 +446,7 @@ public static void loadJournal(Env env, Long logId, JournalEntity journal) { | |||
Frontend fe = (Frontend) journal.getData(); | |||
env.replayDropFrontend(fe); | |||
if (fe.getNodeName().equals(Env.getCurrentEnv().getNodeName())) { | |||
System.out.println("current fe " + fe + " is removed. will exit"); | |||
LOG.info("current fe " + fe + " is removed. will exit"); | |||
LOG.warn("current fe {} is removed. will exit", fe); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem
Followup #35679 and #24556 # Background Previously, the cloud logs were written to files. The main cloud logs include meta_service.INFO and meta_service.WARNING, doris_cloud.out. In a K8s deployment environment, logs usually must be output to standard output, and other components process the log stream. # Solution This PR made the following changes: Modified the glog config: - When started with --daemon, logs are still written to various files, and the format remains unchanged. - When started with --console, meta_service.INFO's log is output to standard output and marked with the prefix RuntimeLogger. Examples are as follows: ``` RuntimeLogger I20240605 23:41:20.426553 4137369 runtime_query_statistics_mgr.cpp:245] Report profile thread stopped ``` Added a new cloud config: `enable_file_logger`, which defaults to true. This indicates that logs will be recorded in files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is false, the log will not be recorded in the file regardless of the startup method.
Followup #35679 and #24556 # Background Previously, the cloud logs were written to files. The main cloud logs include meta_service.INFO and meta_service.WARNING, doris_cloud.out. In a K8s deployment environment, logs usually must be output to standard output, and other components process the log stream. # Solution This PR made the following changes: Modified the glog config: - When started with --daemon, logs are still written to various files, and the format remains unchanged. - When started with --console, meta_service.INFO's log is output to standard output and marked with the prefix RuntimeLogger. Examples are as follows: ``` RuntimeLogger I20240605 23:41:20.426553 4137369 runtime_query_statistics_mgr.cpp:245] Report profile thread stopped ``` Added a new cloud config: `enable_file_logger`, which defaults to true. This indicates that logs will be recorded in files regardless of the startup method. For example, if it is started with `--console`, the log will be output to both the file and the standard output. If it is false, the log will not be recorded in the file regardless of the startup method.
Background
Previously, FE logs were written to files. The main FE logs include fe.log, fe.warn.log, fe.audit.log, fe.out, and fe.gc.log.
In a K8s deployment environment, logs usually need to be output to standard output, and then other components process the log stream.
Solution
This PR made the following changes:
Modified the log4j configuration template
When started with
--daemon
, logs are still written to various files, and the format remains unchanged.When started with
--console
, all logs are output to standard output and marked with different prefixes:StdoutLogger
: logs for standard outputStderrLogger
: logs for standard error outputRuntimeLogger
: logs for fe.log or fe.warn.logAuditLogger:
logs for fe.audit.logExamples are as follows:
Added a new FE config:
enable_file_logger
Defaults to true. Indicates that logs will be recorded to files regardless of the startup method. For example, if it is started with
--console
, the log will be output to both the file and the standard output. If it isfalse
, the log will not be recorded in the file regardless of the startup method.Optimized the log format of standard output
The byte streams of stdout and stderr are captured. The logs previously outputted using
System.out
will be captured in fe.log for unified management.