[GH-ISSUE #2016] feat: Add env vars to control log level and log format #1255

Open
opened 2026-03-02 11:56:06 +03:00 by kerem · 4 comments
Owner

Originally created by @codersaur on GitHub (Oct 7, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2016

Describe the feature you'd like

Standard LOG_LEVEL setting would be handy, as would an env var to control log format. Specifically, it would be great to have an option to log to JSON format.

Describe the benefits this would bring to existing Karakeep users

Easier handling of log messages and ingestion into log aggregation services.

Can the goal of this request already be achieved via other means?

Nope

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundamental request

Additional context

No response

Originally created by @codersaur on GitHub (Oct 7, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2016 ### Describe the feature you'd like Standard LOG_LEVEL setting would be handy, as would an env var to control log format. Specifically, it would be great to have an option to log to JSON format. ### Describe the benefits this would bring to existing Karakeep users Easier handling of log messages and ingestion into log aggregation services. ### Can the goal of this request already be achieved via other means? Nope ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundamental request ### Additional context _No response_
Author
Owner

@petrm commented on GitHub (Oct 7, 2025):

I would add here that it would be great to have separately control over actual application log and the access log. For example, I also have the access log from the reverse proxy, therefore I would like to be able to completely disable it in karakeep.

<!-- gh-comment-id:3376539259 --> @petrm commented on GitHub (Oct 7, 2025): I would add here that it would be great to have separately control over actual application log and the access log. For example, I also have the access log from the reverse proxy, therefore I would like to be able to completely disable it in karakeep.
Author
Owner

@codersaur commented on GitHub (Oct 7, 2025):

I would add here that it would be great to have separately control over actual application log and the access log. For example, I also have the access log from the reverse proxy, therefore I would like to be able to completely disable it in karakeep.

Great point. I agree. My logs are spammed by messages related to the healthcheck "GET /api/health ...".

<!-- gh-comment-id:3376553405 --> @codersaur commented on GitHub (Oct 7, 2025): > I would add here that it would be great to have separately control over actual application log and the access log. For example, I also have the access log from the reverse proxy, therefore I would like to be able to completely disable it in karakeep. Great point. I agree. My logs are spammed by messages related to the healthcheck "GET /api/health ...".
Author
Owner

@aa-ko commented on GitHub (Nov 20, 2025):

Great point. I agree. My logs are spammed by messages related to the healthcheck "GET /api/health ...".

I ran into this as well. After testing, I wanted to suppress all debug logging and did not find any related environment variable in the docs.

However, the linked config.ts does indeed specify a LOG_LEVEL field.

Looking at the winston docs, I just added a LOG_LEVEL=warning to my .env and this seems to just work for now.

To me, this look like it's just missing in the documentation, I think I might open a PR for this.

<!-- gh-comment-id:3559684543 --> @aa-ko commented on GitHub (Nov 20, 2025): > Great point. I agree. My logs are spammed by messages related to the healthcheck "GET /api/health ...". I ran into this as well. After testing, I wanted to suppress all debug logging and did not find any related environment variable in the [docs](https://github.com/karakeep-app/karakeep/blob/main/docs/docs/03-configuration.md). However, the linked [config.ts](https://github.com/karakeep-app/karakeep/blob/1b44eafeb3ced762bedb36b5dfa1f1eae29c4f9f/packages/shared/config.ts#L111) does indeed specify a `LOG_LEVEL` field. Looking at the [winston docs](https://github.com/winstonjs/winston?tab=readme-ov-file#logging-levels), I just added a `LOG_LEVEL=warning` to my `.env` and this seems to just work for now. To me, this look like it's just missing in the documentation, I think I might open a PR for this.
Author
Owner

@aa-ko commented on GitHub (Nov 23, 2025):

@petrm @codersaur You should be able to change the log level setting the way I described. Please take a look at #2166 🙂

<!-- gh-comment-id:3568386246 --> @aa-ko commented on GitHub (Nov 23, 2025): @petrm @codersaur You should be able to change the log level setting the way I described. Please take a look at #2166 🙂
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
starred/karakeep#1255
No description provided.