final CocoonLogFormatter formatter = new CocoonLogFormatter();
formatter.setFormat("%7.7{priority} %{time} [%8.8{category}] " +
"(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}");
final PortletOutputLogTarget servTarget = new PortletOutputLogTarget(this.portletContext, formatter);
final Hierarchy defaultHierarchy = Hierarchy.getDefaultHierarchy();
final ErrorHandler errorHandler = new DefaultErrorHandler();
defaultHierarchy.setErrorHandler(errorHandler);
defaultHierarchy.setDefaultLogTarget(servTarget);
defaultHierarchy.setDefaultPriority(logPriority);
final Logger logger = new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor(""));
final LogKitLoggerManager logKitLoggerManager = new LogKitLoggerManager(defaultHierarchy);
logKitLoggerManager.enableLogging(logger);
final DefaultContext subcontext = new DefaultContext(this.appContext);
subcontext.put("portlet-context", this.portletContext);