Hi,

is there a particular reason why RFC5424Layout#getProcId() always returns
an undefined value (i.e., "-")?

On most VMs, java.lang.management.ManagementFactory.getRuntimeMXBean().getName()
returns <pid>@<host>, so maybe the code could be changed like this:

private static final String PROCESS_ID;
static {
    String name = ManagementFactory.getRuntimeMXBean().getName();
    PROCESS_ID = name.matches("\\d{1,5}@.+") ? name.substring(0, 
name.indexOf('@')) : "-";
}

protected String getProcId() {
    return PROCESS_ID;
}


Adding a real PID would allow to check for program restarts.

Regards,
Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to