why is there a compatibility issue?
Loki4j v1.6.0 requires Logback v1.4.x. If I remember correctly, ILoggingEvent.getNanoseconds()
was introduced back in Logback v1.3.0. So your project is probably using Logback v1.2.3. That's why you have compatibility issue.
You can either force Maven to use Logback v1.4.x, or downgrade Loki4j to version that supports Logback v1.2.x (see compatibility matrix).
Also please note that recent versions of Loki4j support JSON layout natively, so you don't have to specify message pattern like this.