AdguardTeam / AdguardTeam/AdGuardHome

Have "-l syslog" and "log_localtime=true" honor the env TZ data or "/etc/localtime"

Đang mở
#4,207 14 bình luận 0 reaction 1 người được giao Được @ainar-g nhận Xem trên GitHub
documentation
Ngôn ngữ chính
TypeScript
Star
36.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Have a question or an idea? Please search it [on our forum](https://github.com/AdguardTeam/AdGuardHome/discussions) to make sure it was not yet asked. If you cannot find what you had in mind, please [submit it here](https://github.com/AdguardTeam/AdGuardHome/discussions/new).

### Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [X ] I am running the latest version
- [ X] I checked the documentation and found no answer
- [ X] I checked to make sure that this issue has not already been filed

### Problem Description
When both "-l syslog" and "log_localtime=true" , system log does not properly parse the available TZ data for the correct time zone. Instead, UTC is used.
Here is an example of what the problem looks like.

`Jan 26 00:38:41 RT-AX88U-C7C0 dnsmasq[5042]: using 11 more local addresses`
`Jan 26 00:38:41 RT-AX88U-C7C0 custom_script: Running /jffs/scripts/service-event-end (args: restart dnsmasq)`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244226 [info] Starting the DNS proxy server`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244345 [info] Ratelimit is enabled and set to 20 rps`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244367 [info] The server is configured to refuse ANY requests`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244385 [info] DNS cache is enabled`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244492 [info] MaxGoroutines is set to 300`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244533 [info] Creating the UDP server socket`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244700 [info] Listening to udp://[::]:53`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244720 [info] Creating a TCP server socket`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.244810 [info] Listening to tcp://[::]:53`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.245790 [info] Entering the tcp listener loop on [::]:53`
`Jan 26 05:38:42 RT-AX88U-C7C0 AdGuardHome[4920]: 2022/01/26 05:38:42.246830 [info] Entering the UDP listener loop on [::]:53`
`Jan 26 00:39:05 RT-AX88U-C7C0 rc_service: httpd 1321:notify_rc start_scmerlingetaddonpages;start_scmerlingetcronjobs`
`Jan 26 00:39:05 RT-AX88U-C7C0 custom_script: Running /jffs/scripts/service-event (args: start scmerlingetaddonpages)`
`Jan 26 00:39:05 RT-AX88U-C7C0 custom_script: Running /jffs/scripts/service-event-end (args: start scmerlingetaddonpages)`
`Jan 26 00:39:05 RT-AX88U-C7C0 custom_script: Running /jffs/scripts/service-event (args: start scmerlingetcronjobs)`
`Jan 26 00:39:05 RT-AX88U-C7C0 custom_script: Running /jffs/scripts/service-event-end (args: start scmerlingetcronjobs)`
`Jan 26 00:39:07 RT-AX88U-C7C0 rc_service: httpd 1321:notify_rc start_addon_settings;start_connmoncustomactionlist;st`

### Proposed Solution
The solution to the problem would for the GO, or what ever mechanisms AdGuardHome uses, to be able to properly parse the environment TZ data. For example,
`export TZ=$(cat /etc/TZ)`
or have AdGuardHome parse for
`/etc/localtime`.

### Alternatives Considered
Here is an example from the go.dev source.

https://go.dev/src/time/zoneinfo_unix.go

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.