GitHub user amosshi created a discussion: JSON Template Layout - level - short 
name

In the document it reads:
- 
https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#event-template-resolver-pattern

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

In our current settings, we do use pattern for the log `level`, which generates 
only 1 character to save disk space, and somewhat readable, like
- `I` for INFO
- `W` for WARN
- `E` for ERROR

```json
  "logLevel": {
    "$resolver": "pattern",
    "pattern": "%level{length=1}"
  }
```

In today's **JSON Template Layout**, we do have another option of `severity / 
code`, which will generate a number for level based on [Syslog 
severity](https://en.wikipedia.org/wiki/Syslog#Severity_levels), like
- `6` for INFO
- `4` for WARN
- `3` for ERROR

```
config         = field , [ severity ]
field          = "field" -> ( "name" | "severity" )
severity       = severity-field
severity-field = "field" -> ( "keyword" | "code" )
```

  Well it is clear the `severity code` (4, 5, 6) is **NOT reader friendly** and 
we need a mapping to make it readable.

### The Request

- It will be perfect JSON Template Layout can natively support the `single 
character level`




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

----
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