Skip to content
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

[LOG] Set default log level to 'debug' #1134

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/contribute/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<argument>`).

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

Expand Down
2 changes: 1 addition & 1 deletion saros_log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Using this configuration file requires to set the main arguments:

<Loggers>

<Root level="all">
<Root level="debug">
<AppenderRef ref="SarosConsoleAppender"/>
<AppenderRef ref="FileLogAppender"/>
<AppenderRef ref="ErrorFileAppender"/>
Expand Down