private LoggerContext configureLogging(final String workerName, final String logDirectory) throws EngineException {

		final ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory();

		if (iLoggerFactory instanceof Context) {
			final Context context = (Context) iLoggerFactory;
			final LoggerContext result = (LoggerContext) iLoggerFactory;

			final JoranConfigurator configurator = new JoranConfigurator();
			configurator.setContext(context);
			context.putProperty("WORKER_NAME", workerName);
			context.putProperty("LOG_DIRECTORY", logDirectory);

			try {
				configurator.doConfigure(GrinderProcess.class.getResource("/logback-worker.xml"));
			} catch (final JoranException e) {
				throw new EngineException("Could not initialise logger", e);
			}

			return result;
		} else {
			m_terminalLogger.warn("Logback not found; grinder log configuration will be ignored.\n"
					+ "Consider adding logback-classic to the start of the CLASSPATH.");

			return null;
		}
	}
Creates a new <code>GrinderProcess</code> instance.

@param agentReceiver Receiver used to listen to the agent.
@throws net.grinder.common.GrinderException
         If the process could not be created.
ngrinder-runtime/src/main/java/net/grinder/engine/process/GrinderProcess.java