Hello.

This might not be the right place to ask this (maybe log4j?), however my 
question goes:

I would like a JSON log format. I'm looking at 
https://logging.apache.org/log4j/2.x/manual/json-template-layout.html And can't 
figure out how to access the fields referred in:
        <Pattern>
          %maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) 
[%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ 
r:%X{replica}}%notEmpty{ x:%X{core}}%notEmpty{ t:%X{trace_id}}] %c{1.} 
%m%notEmpty{ =>%ex{short}}}{10240}%n
        </Pattern>

as collection/shard/replica. When I use resolver "mdc" (As I understand X to be 
from https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout) in 
my JSON template I get:
{"core":"corepo","rid":"null-5","trace_id":"null-5"}
Any thoughts on how to log those?

It would be awfully useful to know, if one replica is significantly slower that 
the others in same shard (to monitor disk degradation).

\Morten

Reply via email to