Example usage for com.liferay.portal.kernel.log SanitizerLogWrapper allowCRLF

List of usage examples for com.liferay.portal.kernel.log SanitizerLogWrapper allowCRLF

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.log SanitizerLogWrapper allowCRLF.

Prototype

public static Log allowCRLF(Log log) 

Source Link

Usage

From source file:com.liferay.server.admin.web.internal.portlet.action.EditServerMVCActionCommand.java

License:Open Source License

protected void runScript(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    String language = ParamUtil.getString(actionRequest, "language");
    String script = ParamUtil.getString(actionRequest, "script");

    PortletConfig portletConfig = getPortletConfig(actionRequest);

    PortletContext portletContext = portletConfig.getPortletContext();

    Map<String, Object> portletObjects = ScriptingHelperUtil.getPortletObjects(portletConfig, portletContext,
            actionRequest, actionResponse);

    UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();

    UnsyncPrintWriter unsyncPrintWriter = UnsyncPrintWriterPool.borrow(unsyncByteArrayOutputStream);

    portletObjects.put("out", unsyncPrintWriter);

    try {//from   w ww  . j ava 2  s.  c om
        SessionMessages.add(actionRequest, "language", language);
        SessionMessages.add(actionRequest, "script", script);

        _scripting.exec(null, portletObjects, language, script);

        unsyncPrintWriter.flush();

        SessionMessages.add(actionRequest, "scriptOutput", unsyncByteArrayOutputStream.toString());
    } catch (ScriptingException se) {
        SessionErrors.add(actionRequest, ScriptingException.class.getName(), se);

        Log log = SanitizerLogWrapper.allowCRLF(_log);

        log.error(se.getMessage());
    }
}

From source file:com.liferay.server.admin.web.internal.portlet.action.EditServerMVCActionCommand.java

License:Open Source License

protected void threadDump() throws Exception {
    if (_log.isInfoEnabled()) {
        Log log = SanitizerLogWrapper.allowCRLF(_log);

        log.info(ThreadUtil.threadDump());
    } else {/*from  www .j a  v  a 2s.  c  om*/
        Class<?> clazz = getClass();

        _log.error("Thread dumps require the log level to be at least INFO for " + clazz.getName());
    }
}