is Slf4jConfiguration.setLoggerFile(File) API useful?

This commit is contained in:
Hervé Boutemy 2012-12-18 04:11:57 +01:00
parent 3849bbd46a
commit e950603218
1 changed files with 7 additions and 4 deletions

View File

@ -298,9 +298,9 @@ public class MavenCli
}
}
//
// All logging is handled by SFL4J
//
/**
* configure logging
*/
private void logging( CliRequest cliRequest )
{
cliRequest.debug = cliRequest.commandLine.hasOption( CLIManager.DEBUG );
@ -327,7 +327,8 @@ public class MavenCli
{
File logFile = new File( cliRequest.commandLine.getOptionValue( CLIManager.LOG_FILE ) );
logFile = resolveFile( logFile, cliRequest.workingDirectory );
slf4jConfiguration.setLoggerFile( logFile );
// redirect stdout and stderr to file
try
{
PrintStream ps = new PrintStream( new FileOutputStream( logFile ) );
@ -340,6 +341,8 @@ public class MavenCli
// Ignore
//
}
slf4jConfiguration.setLoggerFile( logFile ); // is it really useful? redirecting stdout/stderr isn't sufficient in all cases?
}
plexusLoggerManager = new Slf4jLoggerManager();