From 161f7695fbd19c47e4eae461d897b0c6db9df9cf Mon Sep 17 00:00:00 2001 From: Tobias Bouschen Date: Mon, 1 Mar 2021 14:51:18 +0100 Subject: [PATCH] [LOG] Set default log level to 'debug' Sets the default log level to 'debug'. For most development or even debugging tasks, the 'trace' log level should not be necessary. It provides very detailed information for many background processes that often aren't of interest. This floods the logs with way too many messages to properly discern the important information. If the 'trace' level is actually needed, it can still be set manually be the developer. Adjusts the Logging page to specify the correct base log level. Also adds a section on how to set the log level during development. --- docs/contribute/logging.md | 9 +++++++-- saros_log4j2.xml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/contribute/logging.md b/docs/contribute/logging.md index 76fe0d5035..e47132bbeb 100644 --- a/docs/contribute/logging.md +++ b/docs/contribute/logging.md @@ -10,13 +10,18 @@ Since Saros is an IDE plugin, the log dir depends on the IDEs configurations. Therefore, initializing the logging in Saros comprises the steps: 1. The default log4j2 initializing is executed that uses the configuration file `log4j2.xml` (has to be included in the classpath). 2. Our custom initializing starts: - * We determine the IDEs log directory and the required log level (e.g. `all` if Saros is running the debug-mode). + * We determine the IDEs log directory and the required log level (e.g. `debug` if Saros is running the debug-mode). * We set the main arguments `logLevel` and `logDir`. * We force log4j to reinitialize with the log configuration `saros_log4j2.xml` that uses the defined arguments ( with the format `main:`). See the initializing in the classes [`Saros`](https://github.com/saros-project/saros/blob/master/eclipse/src/saros/Saros.java) (in Eclipse) or [`SarosComponent`](https://github.com/saros-project/saros/blob/master/intellij/src/saros/intellij/SarosComponent.java) (in IntelliJ) -for example implementations. Sometimes (as in the Saros Server) using the default initializing is enough. +for example implementations. Sometimes (as in the Saros Server) using the default initializing is enough. + +### Settings a different log level during development + +Sometimes you might have the need for a different log level during development, e.g. if you are interested in `trace` level logging. +To adjust the log level, you can modify the `root` log level in the `Loggers` section of the `saros_log4j2.xml`. ## Ongoing migration from log4j-1.2 -> log4j2 diff --git a/saros_log4j2.xml b/saros_log4j2.xml index 0b4cb089bf..31a22fb359 100644 --- a/saros_log4j2.xml +++ b/saros_log4j2.xml @@ -36,7 +36,7 @@ Using this configuration file requires to set the main arguments: - +