Here you can find the source of resolveXmlConfigUrl(@Nullable URL defaultXmlConfigUrl)
@Nonnull private static URL resolveXmlConfigUrl(@Nullable URL defaultXmlConfigUrl)
//package com.java2s; /***************************************************************************************** * *** BEGIN LICENSE BLOCK *****/*from ww w .j a va2 s . co m*/ * * Version: MPL 2.0 * * echocat Jomon, Copyright (c) 2012-2013 echocat * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * *** END LICENSE BLOCK ***** ****************************************************************************************/ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.net.MalformedURLException; import java.net.URL; public class Main { @Nonnull private static URL resolveXmlConfigUrl(@Nullable URL defaultXmlConfigUrl) { final String plainConfigUrl = System.getProperty("log4j.configuration", defaultXmlConfigUrl != null ? defaultXmlConfigUrl.toExternalForm() : null); if (plainConfigUrl == null) { throw new IllegalArgumentException("The system property 'log4j.configuration' is not set."); } try { return new URL(plainConfigUrl); } catch (final MalformedURLException e) { throw new IllegalArgumentException("The given xmlConfig '" + plainConfigUrl + "' is no valid url.", e); } } }