Implement this method to create your own layout format.
@param {Log4js.LoggingEvent} loggingEvent loggingEvent to format
@return formatted String
@type String
976350
function(loggingEvent) {
		return loggingEvent.categoryName + "~" + loggingEvent.startTime.toLocaleString() + " [" + loggingEvent.level.toString() + "] " + loggingEvent.message + this.LINE_SEP;
	}
374815
@Override
	protected void append( LoggingEvent event) {

		// Render the event according to layout
		String formattedEvent = layout.format( event);

		// Append stack trace if present and layout does not handle it
		if (layout.ignoresThrowable()) {
			String[] stack = event.getThrowableStrRep();
			if (stack != null)
			{
				int len = stack.length;
				formattedEvent += ", ";
				for(int i = 0; i < len; i++)
				{
					formattedEvent += stack[i];
					if(i < len - 1)
						formattedEvent += "\u2028";
				}
			}
		}
				
		// Prepare to be queued
		this.le_async.addLineToQueue(formattedEvent);
	}
368998
function log(text) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'success';
  var debug$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

  if (!debug$$1) {
    return;
  }

  var success = 'padding: 2px; background: #219621; color: #ffffff';
  var warning = 'padding: 2px; background: #f1e05a; color: #333333';
  var error = 'padding: 2px; background: #b9090b; color: #ffffff';
  var types = { error: error, success: success, warning: warning };

  console.log('%c [Storage Helper] ' + text + ' ', types[type]);
}
73423
private static String formatSimple(ChannelHandlerContext ctx, String eventName, Object msg) {
        String chStr = ctx.channel().toString();
        String msgStr = String.valueOf(msg);
        StringBuilder buf = new StringBuilder(chStr.length() + 1 + eventName.length() + 2 + msgStr.length());
        return buf.append(chStr).append(' ').append(eventName).append(": ").append(msgStr).toString();
    }
560750
function(msg){
		var logs = document.getElementById("logs");
		logs.innerHTML += Funcs.util.getTimeStamp() + ": " + msg + "\n";
	}
390353
function formatNode(node) {
  var log = node.type
  var location = node.position || {}
  var position = stringify(location.start, location.end)
  var key
  var values = []
  var value

  if (node.children) {
    log += dim('[') + yellow(node.children.length) + dim(']')
  } else if (typeof node.value === 'string') {
    log += dim(': ') + green(JSON.stringify(node.value))
  }

  if (position) {
    log += ' (' + position + ')'
  }

  for (key in node) {
    value = node[key]

    if (
      ignore.indexOf(key) !== -1 ||
      value === null ||
      value === undefined ||
      (typeof value === 'object' && isEmpty(value))
    ) {
      continue
    }

    values.push('[' + key + '=' + JSON.stringify(value) + ']')
  }

  if (values.length !== 0) {
    log += ' ' + values.join('')
  }

  return log
}
322209
public function format(\n2n\log4php\logging\LoggingEvent $event) {
		$ns = $this->namespacePrefix;
		
		$loggerName = $event->getLoggerName();
		$timeStamp = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
		$thread = $event->getThreadName();
		$level = $event->getLevel()->toString();

		$buf  = "<$ns:event logger=\"{$loggerName}\" level=\"{$level}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
		$buf .= "<$ns:message>"; 
		$buf .= $this->encodeCDATA($event->getRenderedMessage()); 
		$buf .= "</$ns:message>".PHP_EOL;

		$ndc = $event->getNDC();
		if(!empty($ndc)) {
			$buf .= "<$ns:NDC><![CDATA[";
			$buf .= $this->encodeCDATA($ndc);
			$buf .= "]]></$ns:NDC>".PHP_EOL;
		}
		
		$mdcMap = $event->getMDCMap();
		if (!empty($mdcMap)) {
			$buf .= "<$ns:properties>".PHP_EOL;
			foreach ($mdcMap as $name=>$value) {
				$buf .= "<$ns:data name=\"$name\" value=\"$value\" />".PHP_EOL;
			}
			$buf .= "</$ns:properties>".PHP_EOL;
		}

		if ($this->getLocationInfo()) {
			$locationInfo = $event->getLocationInformation();
			$buf .= "<$ns:locationInfo ". 
					"class=\"" . $locationInfo->getClassName() . "\" ".
					"file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
					"line=\"" .  $locationInfo->getLineNumber() . "\" ".
					"method=\"" . $locationInfo->getMethodName() . "\" ";
			$buf .= "/>".PHP_EOL;
		}

		$buf .= "</$ns:event>".PHP_EOL;
		
		return $buf;
	}
1288194
@Override
    public String format(AuditEvent event) {
        String formatText = super.format(event);

        try {
            return util.encrypt(formatText);
        } catch (InvalidKeyException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (IllegalBlockSizeException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (BadPaddingException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (UnsupportedEncodingException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (InvalidAlgorithmParameterException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (NoSuchAlgorithmException e) {
            throw new Audit4jRuntimeException("", e);
        } catch (NoSuchPaddingException e) {
            throw new Audit4jRuntimeException("", e);
        }
    }
1350526
function Formatter(format, timeFormat) {
	format = format || '%(message)';
	timeFormat = timeFormat || '%Y-%m-%d %H:%M:%S';

	/**
	 * @private
	 * @type {string}
	 */
	this._format = format;

	/**
	 * @private
	 * @type {string}
	 */
	this._timeFormat = timeFormat;
}
1030775
public String format(LogRecord record) {
        StringBuffer sb = new StringBuffer();
        String message = formatMessage(record);
        sb.append(message);
        sb.append(lineSeparator);
        if (record.getThrown() != null) {
            try {
                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
                record.getThrown().printStackTrace(pw);
                pw.close();
            sb.append(sw.toString());
            } catch (Exception ex) {
            	if (record.getThrown().getCause() != null){
					sb.append(record.getThrown().getCause().getLocalizedMessage());
            	}else{
					sb.append(record.getThrown().getLocalizedMessage());
            	}
            	
            }
        }
        return sb.toString();
    }
971529
def format(event)
      #@@basicformat      "%*s %s"
      #~ buff = sprintf("%-*s %-5s", Log4r::MaxLevelLength, Log4r::LNAMES[event.level],
             #~ event.data.is_a?(Array) ? event.data.first : event.name)
      buff = "%5s" % (event.data.is_a?(Array) ? event.data.first : event.name)
      #~ buff += (event.tracer.nil? ? "" : "(#{event.tracer[2]})") + ": "
      buff << ": "
      buff << format_object(event.data.is_a?(Array) ? event.data.last : event.data) 
      buff << (event.tracer.nil? ? "" : " (#{event.tracer.join('/')})")
      buff << "\n"
      buff
    end
1211343
protected EventBuilder createEventBuilder(LogEvent event) {
        Message eventMessage = event.getMessage();
        EventBuilder eventBuilder = new EventBuilder()
            .withSdkIntegration("log4j2")
            .withTimestamp(new Date(event.getTimeMillis()))
            .withMessage(eventMessage.getFormattedMessage())
            .withLogger(event.getLoggerName())
            .withLevel(formatLevel(event.getLevel()))
            .withExtra(THREAD_NAME, event.getThreadName());

        if (eventMessage.getFormat() != null
            && !eventMessage.getFormat().equals("")
            && !eventMessage.getFormattedMessage().equals(eventMessage.getFormat())) {
            eventBuilder.withSentryInterface(new MessageInterface(
                eventMessage.getFormat(),
                formatMessageParameters(eventMessage.getParameters()),
                eventMessage.getFormattedMessage()));
        }

        Throwable throwable = event.getThrown();
        if (throwable != null) {
            eventBuilder.withSentryInterface(new ExceptionInterface(throwable));
        } else if (event.getSource() != null) {
            StackTraceElement[] stackTrace = {event.getSource()};
            eventBuilder.withSentryInterface(new StackTraceInterface(stackTrace));
        }

        if (event.getContextStack() != null) {
            eventBuilder.withExtra(LOG4J_NDC, event.getContextStack().asList());
        }

        if (event.getContextMap() != null) {
            for (Map.Entry<String, String> contextEntry : event.getContextMap().entrySet()) {
                if (Sentry.getStoredClient().getMdcTags().contains(contextEntry.getKey())) {
                    eventBuilder.withTag(contextEntry.getKey(), contextEntry.getValue());
                } else {
                    eventBuilder.withExtra(contextEntry.getKey(), contextEntry.getValue());
                }
            }
        }

        if (event.getMarker() != null) {
            eventBuilder.withTag(LOG4J_MARKER, event.getMarker().getName());
        }

        return eventBuilder;
    }
95974
private static String formatLogParam(Array obj) {
		String result="";
		try {
			result= "(array of type"+obj.getBaseTypeName().length()+")";
		} catch (SQLException e) {
			result = "(array of unknown type)";
		}
		return result;
	}
1344282
function log(message) {
    var childDiv = document.createElement("div");
    var textNode = document.createTextNode(message);
    childDiv.appendChild(textNode);
    document.getElementById("log").appendChild(childDiv);
  }
872521
public static String format (Object message, Object... args)
    {
        return new LogBuilder(message, args).toString();
    }
699832
function log( func, msg ){
  var logline = '['+func+'] '+msg;

  if ( logInfo ) {
    if ( logInfoStr == '' ) {
      console.log( logline );      
    } else if ( logInfoStr.indexOf( func ) >= 0 ) { 
      console.log( logline );
    }
  }

  // send log to event broker
  if ( loggerEvents ) { 
    var logBroker = getEventBroker('log');
    logBroker.cleanupQueue( 1000 );
    logBroker.queueEvent( { text: logline, channel:'log' } );
  }
  
}
1098663
@Override
	public String format(AuditEvent event) {
		final StringBuilder buff = new StringBuilder();
		if (null != event.getTimestamp()) {
			buff.append(new ConcurrentDateFormatAccess(dateFormat).convertDateToString(event.getTimestamp()));
		} else {
			buff.append(new ConcurrentDateFormatAccess(dateFormat).convertDateToString(new Date()));
		}
		buff.append(CoreConstants.PIPE);
		if (null != event.getUuid()) {
			buff.append(event.getUuid().toString());
			buff.append(CoreConstants.PIPE);
		}

		buff.append(event.getActor());
		buff.append(CoreConstants.PIPE);
		buff.append(event.getOrigin());
		buff.append(CoreConstants.PIPE);

		if (event.getAction() != null) {
			buff.append(event.getAction()).append(CoreConstants.ARROW);
		}
		if (event.getFields() != null && !event.getFields().isEmpty()) {
			for (Field actionItem : event.getFields()) {
				buff.append(actionItem.getName()).append(CoreConstants.SPACE).append(actionItem.getType())
						.append(CoreConstants.COLON_CHAR).append(actionItem.getValue())
						.append(CoreConstants.COMMA_CHAR);
			}
		}
		return buff.toString();
	}