-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Expose logging levels configuration #600
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,6 +511,19 @@ void logging( CliRequest cliRequest ) | |
| slf4jLoggerFactory = LoggerFactory.getILoggerFactory(); | ||
| Slf4jConfiguration slf4jConfiguration = Slf4jConfigurationFactory.getConfiguration( slf4jLoggerFactory ); | ||
|
|
||
| String[] verboseLoggers = null; | ||
| if ( cliRequest.commandLine.hasOption( CLIManager.VERBOSE_LOGGERS ) ) | ||
| { | ||
| verboseLoggers = cliRequest.commandLine.getOptionValues( CLIManager.VERBOSE_LOGGERS ); | ||
| } | ||
| if ( verboseLoggers != null ) | ||
| { | ||
| for ( String verboseLogger : verboseLoggers ) | ||
| { | ||
| slf4jConfiguration.setLoggerLevel( verboseLogger, Slf4jConfiguration.Level.DEBUG ); | ||
| } | ||
| } | ||
|
|
||
| if ( cliRequest.verbose ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should |
||
| { | ||
| cliRequest.request.setLoggingLevel( MavenExecutionRequest.LOGGING_LEVEL_DEBUG ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know why any chance what this actually does? Since we cannot set it for the above?! |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,12 @@ public class Log4j2Configuration | |
| { | ||
| @Override | ||
| public void setRootLoggerLevel( Level level ) | ||
| { | ||
| setLoggerLevel( "root", level ); | ||
| } | ||
|
|
||
| @Override | ||
| public void setLoggerLevel( final String loggerName, final Level level ) | ||
| { | ||
| String value; | ||
| switch ( level ) | ||
|
|
@@ -48,7 +54,7 @@ public void setRootLoggerLevel( Level level ) | |
| value = "error"; | ||
| break; | ||
| } | ||
| System.setProperty( "maven.logging.root.level", value ); | ||
| System.setProperty( "maven.logging." + loggerName + ".level", value ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, I didn't even know that we have this. Why do we have it and why do we need it? |
||
| } | ||
|
|
||
| @Override | ||
|
|
||
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.
This sould be kebab case like other long options.
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.
The
descshould be similar to one ofACTIVATE_PROFILES, structurally.