google / google/flogger

Log4j2 - Ignores %line and incorrect logger name

Open
#144 7 comments 0 reactions 0 assignees View on GitHub
P3 type=defect
Dominant language
Java
Stars
1.5k
Forks
133
Avg merge
6m
Merged PRs (30d)
7

Description

Hi,

Thank you for adding log4j2 support.

When trying to use v 0.5 with the attached [line-number-test.zip](https://github.com/google/flogger/files/4377921/line-number-test.zip) I see the following output:

```
2020-03-25T00:26:20,476 [main] INFO example.LogTest:INFO in 18b4aac2: - Info
2020-03-25T00:26:20,484 [main] WARN example.LogTest:INFO in 18b4aac2: - Warn
2020-03-25T00:26:20,484 [main] ERROR example.LogTest:INFO in 18b4aac2: - Severe
```

1. The Logger name is incorrect (should be `example.LogTest` instead of `example.LogTest:INFO in 18b4aac2`
2. The line number is missing from the message although pattern contains `%line` . I noticed there is an internal Option.WITH_LOG_SITE but couldn't find a way to influence that and I would expect that having `%line` would be sufficient.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.