Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When configured with --log-mode=JSON, some logs are still not JSON #12462

Open
2 tasks done
agh opened this issue Jan 1, 2025 · 1 comment
Open
2 tasks done

When configured with --log-mode=JSON, some logs are still not JSON #12462

agh opened this issue Jan 1, 2025 · 1 comment
Labels

Comments

@agh
Copy link

agh commented Jan 1, 2025

Before you start please confirm the following.

Problem Description

I'm starting Portainer with --log-level=INFO and --log-mode=JSON on the CLI, but when the services start, if you follow in docker logs (or wherever you're pumping STDOUT) then not all messages are emitted as JSON.

Expected Behavior

Every message is emitted as JSON.

Actual Behavior

portainer | {"level":"info","private-key":"/data/chisel/private-key.pem","time":1735767710,"caller":"github.com/portainer/portainer-ee/api/chisel/service.go:201","message":"found Chisel private key file on disk"}
portainer | 2025/01/01 21:41:50 server: Reverse tunnelling enabled
portainer | 2025/01/01 21:41:50 server: Fingerprint BG4P8Oii1qLobn6DosXECEcSc3tgBUKDNOYVzPuhg0I=
portainer | 2025/01/01 21:41:50 server: Listening on http://0.0.0.0:8000
portainer | {"level":"info","time":1735767710,"caller":"github.com/portainer/portainer-ee/api/datastore/postinit/migrate_post_init.go:111","message":"Executing post init migration for environment 1"}

Steps to Reproduce

portainer:
image: docker.io/portainer/portainer-ee
container_name: portainer
restart: unless-stopped
command:
- "--license-key=REDACTED"
- "--log-level=INFO"
- "--log-mode=JSON"
volumes:
- /path/to/data:/data
- /var/run/docker.sock:/var/run/docker.sock

Portainer logs or screenshots

No response

Portainer version

2.25.1

Portainer Edition

Business Edition (BE/EE) with 5NF / 3NF license

Platform and Version

Docker 27.4.1

OS and Architecture

Debian Trixie

Browser

No response

What command did you use to deploy Portainer?

No response

Additional Information

No response

@jamescarppe
Copy link
Member

jamescarppe commented Jan 6, 2025

We apply this setting to logs that Portainer itself generates but some of the utilities that we use (in this case, chisel) output logs in their own format directly without passing through Portainer. In saying that, we'll raise this internally to see if there's a way for us to change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants