mirror of https://github.com/apache/maven.git
is Slf4jConfiguration.setLoggerFile(File) API useful?
This commit is contained in:
parent
3849bbd46a
commit
e950603218
|
@ -298,9 +298,9 @@ public class MavenCli
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/**
|
||||||
// All logging is handled by SFL4J
|
* configure logging
|
||||||
//
|
*/
|
||||||
private void logging( CliRequest cliRequest )
|
private void logging( CliRequest cliRequest )
|
||||||
{
|
{
|
||||||
cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
|
cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
|
||||||
|
@ -327,7 +327,8 @@ public class MavenCli
|
||||||
{
|
{
|
||||||
File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
|
File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
|
||||||
logFile = resolveFile( logFile, cliRequest.workingDirectory );
|
logFile = resolveFile( logFile, cliRequest.workingDirectory );
|
||||||
slf4jConfiguration.setLoggerFile( logFile );
|
|
||||||
|
// redirect stdout and stderr to file
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PrintStream ps = new PrintStream( new FileOutputStream( logFile ) );
|
PrintStream ps = new PrintStream( new FileOutputStream( logFile ) );
|
||||||
|
@ -340,6 +341,8 @@ public class MavenCli
|
||||||
// Ignore
|
// Ignore
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slf4jConfiguration.setLoggerFile( logFile ); // is it really useful? redirecting stdout/stderr isn't sufficient in all cases?
|
||||||
}
|
}
|
||||||
|
|
||||||
plexusLoggerManager = new Slf4jLoggerManager();
|
plexusLoggerManager = new Slf4jLoggerManager();
|
||||||
|
|
Loading…
Reference in New Issue