зеркало из
				https://github.com/iharh/notes.git
				synced 2025-10-31 13:46:08 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			13 строки
		
	
	
		
			464 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			13 строки
		
	
	
		
			464 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
 | |
| // LoggerContext ctx = LoggerContext.getContext();
 | |
| Configuration cfg = ctx.getConfiguration();
 | |
| ...
 | |
| ctx.updateLoggers();
 | |
| 
 | |
| if (saveLog4j2Config == null) {
 | |
|     System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
 | |
| } else {
 | |
|     System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, saveLog4j2Config);
 | |
|     ((LoggerContext) LogManager.getContext(false)).reconfigure();
 | |
| }
 | 
