Try using the PaddingLayoutRendererWrapper. I'm not sure where a good config example is, but the source in NLog's source repository is located here, so maybe you can reverse engineer the correct configuration:
I think you would do something like this:
"${date:format=dd.MM.yyyy HH\\:mm\\:ss,fff} | ${padding:padding=5,fixedlength=true:${level:uppercase=true}} | ${message}"
Hopefully, that example will pad all log level values with 5 spaces on the left and then trim to an absolute length of 5.
padding=5
means to add 5 padcharacters (default is ' '
) to left (negative means pad on right)
fixedlength=true
is a boolean that indicates that the padded result should be trimmed to a maximum length of "padding" (i.e. 5 in my example)