logger: Add journald support #971

Merged
fyrchik merged 1 commits from dstepanov-yadro/frostfs-node:feat/zapjournald into master 2024-02-12 06:17:24 +00:00

Relates #736

Now it is possible to specify journald destination for logger.

The same approach as c334adeb6d/cmd/s3-gw/app_settings.go

Now journalctl uses zap's level:
image

Signed-off-by: Dmitrii Stepanov d.stepanov@yadro.com

Relates #736 Now it is possible to specify `journald` destination for logger. The same approach as https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/c334adeb6da0bf6fa889b1bf8bb370ccc80f2b0e/cmd/s3-gw/app_settings.go Now `journalctl` uses zap's level: ![image](/attachments/88551b9c-1073-4a1e-bbe5-41e99e7e04a8) Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
426 KiB
dstepanov-yadro added 1 commit 2024-02-08 14:07:30 +00:00
DCO action / DCO (pull_request) Successful in 1m14s Details
Vulncheck / Vulncheck (pull_request) Successful in 3m28s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 5m23s Details
Build / Build Components (1.21) (pull_request) Successful in 5m1s Details
Build / Build Components (1.20) (pull_request) Successful in 5m8s Details
Tests and linters / Staticcheck (pull_request) Successful in 5m19s Details
Tests and linters / Lint (pull_request) Successful in 5m47s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 7m30s Details
Tests and linters / Tests with -race (pull_request) Successful in 7m22s Details
9d5c42b14a
[#736] logger: Add journald support
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
dstepanov-yadro requested review from storage-core-committers 2024-02-08 14:17:57 +00:00
dstepanov-yadro requested review from storage-core-developers 2024-02-08 14:17:58 +00:00
fyrchik reviewed 2024-02-08 17:35:07 +00:00
@ -1012,1 +1014,4 @@
}
err = c.dynamicConfiguration.logger.SetDestination(c.LoggerCfg.destination)
if err != nil {
// not expected since validation should be performed before

Where is validation performed?
I see a comment in the previous if but it could be misleading too.

Where is validation performed? I see a comment in the previous `if` but it could be misleading too.

Also, do we change this on SIGHUP? Not saying that we need to (it could be even harmful), just to know

Also, do we change this on SIGHUP? Not saying that we need to (it could be even harmful), just to know
Poster
Collaborator

Where is validation performed?

Here: cmd/frostfs-node/validate.go

do we change this on SIGHUP

No.

> Where is validation performed? Here: `cmd/frostfs-node/validate.go` > do we change this on SIGHUP No.
fyrchik marked this conversation as resolved
@ -38,2 +43,4 @@
}
const (
DestinationUndefined = ""

We also have Loki which doesn't use this field. What about unifying the approach? (destination: loki)

We also have `Loki` which doesn't use this field. What about unifying the approach? (`destination: loki`)
Poster
Collaborator

loki works with both of journald and stdout, it is not a destination.

`loki` works with both of `journald` and `stdout`, it is not a destination.

Journald core can work with stdout too (it does by default I think)

Journald core can work with stdout too (it does by default I think)
Poster
Collaborator

So then destination possible values will be stdout, journald, stdout+loki, journald+loki? Looks ... strange.

So then `destination` possible values will be `stdout`, `journald`, `stdout+loki`, `journald+loki`? Looks ... strange.
fyrchik approved these changes 2024-02-09 14:15:55 +00:00
acid-ant approved these changes 2024-02-11 06:36:32 +00:00
fyrchik merged commit 962e5a9c19 into master 2024-02-12 06:17:24 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#971
There is no content yet.