org.elasticsearch.common.logging.slf4j.Slf4jESLoggerFactory Java Examples

The following examples show how to use org.elasticsearch.common.logging.slf4j.Slf4jESLoggerFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebRestApiApplication.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
public static void main(final String[] args)
{
	if (Check.isEmpty(System.getProperty("PropertyFile"), true))
	{
		System.setProperty("PropertyFile", "./metasfresh.properties");
	}

	// Make sure slf4j is used (by default, in v2.4.4 log4j is used, see https://github.com/metasfresh/metasfresh-webui-api/issues/757)
	ESLoggerFactory.setDefaultFactory(new Slf4jESLoggerFactory());

	try (final IAutoCloseable c = ModelValidationEngine.postponeInit())
	{
		Ini.setRunMode(RunMode.WEBUI);
		Adempiere.instance.startup(RunMode.WEBUI);

		final ArrayList<String> activeProfiles = retrieveActiveProfilesFromSysConfig();
		activeProfiles.add(Profiles.PROFILE_Webui);

		final String headless = System.getProperty(SYSTEM_PROPERTY_HEADLESS, Boolean.toString(true));

		new SpringApplicationBuilder(WebRestApiApplication.class)
				.headless(Boolean.parseBoolean(headless)) // we need headless=false for initial connection setup popup (if any), usually this only applies on dev workstations.
				.web(true)
				.profiles(activeProfiles.toArray(new String[0]))
				.beanNameGenerator(new MetasfreshBeanNameGenerator())
				.run(args);
	}

	// now init the model validation engine
	ModelValidationEngine.get();
}