Add support for including process PID in the layout / multiprocess #143

nickminutello opened this Issue Jul 15, 2013 · 0 comments


None yet

1 participant


It requires:

  1. A pattern so the pid can be defined in the layout format
  2. multi-process has to add the pid to the logging event before sending it.

Change to multiprocess.js:

    function write(loggingEvent) { =; // add PID
        socket.write(JSON.stringify(loggingEvent), 'utf8');
        socket.write(END_MSG, 'utf8');

Change to layouts.js:

function timestampLevelAndCategory(loggingEvent, colour) {
    var output = colorize(
            '[PID %s] [%s] [%s] %s - '
          , || // If its a remote logging event, want to use the pid from the event.
          , dateFormat.asString(loggingEvent.startTime)
          , loggingEvent.level
          , loggingEvent.categoryName
      , colour
    return output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment