public synchronized static Logger getLogger() {
		
		if(logger == null) {
			try {
				logger = Logger.getLogger("RedpinLogger");
				FileHandler fh = new FileHandler(Configuration.LogFile);
				
				if(Configuration.LogFormat == LoggerFormat.PLAIN) {
					fh.setFormatter(new SimpleFormatter());
				} else if(Configuration.LogFormat == LoggerFormat.XML) {
					fh.setFormatter(new XMLFormatter());
				} else {
					//default
					fh.setFormatter(new SimpleFormatter());					
				}
				
				logger.addHandler(fh);
				logger.setLevel(Configuration.LogLevel);
			} catch (SecurityException e) {
				// TODO Auto-generated catch block
				System.err.println(e.getMessage());
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				System.err.println(e.getMessage());
				e.printStackTrace();
			}
		} 
		
		return logger;
		
	}