log4j fallback on basic configurator if no file access
This commit is contained in:
parent
f187981cd6
commit
8889712071
1 changed files with 11 additions and 9 deletions
|
@ -24,7 +24,7 @@
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: GUI.java,v 1.74 2008/03/19 09:40:38 fros4943 Exp $
|
* $Id: GUI.java,v 1.75 2008/04/02 16:41:46 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja;
|
package se.sics.cooja;
|
||||||
|
@ -45,6 +45,7 @@ import javax.swing.*;
|
||||||
import javax.swing.event.MenuEvent;
|
import javax.swing.event.MenuEvent;
|
||||||
import javax.swing.event.MenuListener;
|
import javax.swing.event.MenuListener;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
import org.apache.log4j.BasicConfigurator;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.apache.log4j.xml.DOMConfigurator;
|
import org.apache.log4j.xml.DOMConfigurator;
|
||||||
import org.jdom.Document;
|
import org.jdom.Document;
|
||||||
|
@ -2916,16 +2917,17 @@ public class GUI {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Configure logger
|
// Configure logger
|
||||||
if ((new File(LOG_CONFIG_FILE)).exists()) {
|
if ((new File(LOG_CONFIG_FILE)).exists()) {
|
||||||
DOMConfigurator.configure(LOG_CONFIG_FILE);
|
DOMConfigurator.configure(LOG_CONFIG_FILE);
|
||||||
} else {
|
} else {
|
||||||
// Used when starting from jar
|
// Used when starting from jar
|
||||||
DOMConfigurator.configure(GUI.class.getResource("/" + LOG_CONFIG_FILE));
|
DOMConfigurator.configure(GUI.class.getResource("/" + LOG_CONFIG_FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
externalToolsUserSettingsFile = new File(System.getProperty("user.home"), EXTERNAL_TOOLS_USER_SETTINGS_FILENAME);
|
externalToolsUserSettingsFile = new File(System.getProperty("user.home"), EXTERNAL_TOOLS_USER_SETTINGS_FILENAME);
|
||||||
} catch (AccessControlException e) {
|
} catch (AccessControlException e) {
|
||||||
|
BasicConfigurator.configure();
|
||||||
externalToolsUserSettingsFile = null;
|
externalToolsUserSettingsFile = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue