clientName is not resolved from hosts file within the csv-client logger
## Description
Happy holidays!
I have configured a hosts file listing all clients on my LAN. Their name resolution works fine as expected but the generated `csv-client` log contains only IP addresses in place of the `clientName` field (all default fields are logged).
```shell
$ cat logs/2025-12-25_192_168_1_11.log
2025-12-25 04:36:02 192.168.1.11 192.168.1.11 0 BLOCKED (custom) ping.ui.com. A (0.0.0.0) NOERROR BLOCKED A blocky
2025-12-25 10:36:02 192.168.1.11 192.168.1.11 0 BLOCKED (custom) ping.ui.com. A (0.0.0.0) NOERROR BLOCKED A blocky
2025-12-25 16:36:02 192.168.1.11 192.168.1.11 0 BLOCKED (custom) ping.ui.com. A (0.0.0.0) NOERROR BLOCKED A blocky
# Unexpected 2nd client IP instead of clientName in the logs
# But name resolution works fine, so I assume the clientName could be in the logs too
$ blocky query unifi
[2025-12-25 18:17:12] INFO Query result for 'unifi' (A):
[2025-12-25 18:17:12] INFO reason: HOSTS FILE
[2025-12-25 18:17:12] INFO response type: HOSTSFILE
[2025-12-25 18:17:12] INFO response: A (192.168.1.11)
[2025-12-25 18:17:12] INFO return code: NOERROR
```
## Expected result
When using the `csv-client` logger along with hosts file(s), the `clientName` log attribute is resolved from the hosts file.
If possible, I'd also prefer to have the `clientName` as part of the log file name instead of the IP address for easy identification:
```diff
- 2025-12-25_192_168_1_11.log
+ 2025-12-25_unifi.log
```
## Additional info
Blocky version (latest):
- Version: v0.28.2
- Build time: 20251117-212247
- Architecture: amd64
5 条评论