GitHub user amosshi created a discussion: JSON Template Layout - logger - only 
the class name without the package

In the [JSON Template Layout 
document](https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#event-template-resolver-pattern)
 it reads:

>  If you find yourself using pattern, it is highly likely you are either doing 
> something wrong, or JSON Template Layout needs some improvement.

### The Problem

In today, JSON Template Layout has no way to generate logger Class Name 
**without the Java package**

```
logger event template grammar
config = "field" -> ( "name" | "fqcn" )
``` 

Well usually the Java package is too long and we want to skip it to save disk 
space, especially for a high traffic data center.

### The Pattern Solution

In Pattern layout we can achieve it easily via `"%c{1}` , while there is no 
such option in JSON Template Layout unfortunately. 

```json
  "logger": {
    "$resolver": "pattern",
    "pattern": "%c{1}",
  }
```

### The Idea

How about add a new option for logger, like `shortName`, which only generate 
the class name without the package.



GitHub link: https://github.com/apache/logging-log4j2/discussions/3890

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@logging.apache.org

Reply via email to