protected Path resolveLog4j2()

in proposals/gk/log4j2/src/java/org/apache/turbine/Turbine.java [941:964]


    protected Path resolveLog4j2( Path logConfPath )
    {
        String log4jFile = configuration.getString(TurbineConstants.LOG4J2_CONFIG_FILE,
                                                   TurbineConstants.LOG4J2_CONFIG_FILE_DEFAULT);
                        
        if (log4jFile.startsWith( "/" ))
        {
            log4jFile = log4jFile.substring( 1 );
        }
        Path log4jTarget = null;
        if (StringUtils.isNotEmpty(log4jFile) && !log4jFile.equalsIgnoreCase("none")) {
            // log4j must either share path with configuration path or resolved relatively
            
            if ( logConfPath != null )
            {
                Path logFilePath = logConfPath.resolve( log4jFile );
                if ( logFilePath != null && Files.exists( logFilePath ))
                {
                    log4jTarget = logFilePath.normalize();
                }
            }
        }
        return log4jTarget;
    }