klogging icon indicating copy to clipboard operation
klogging copied to clipboard

How to set various options without environment variables

Open cwrau opened this issue 2 years ago • 4 comments

Some options, like KLOGGING_FF_EXECUTOR_THREAD_POOL look like they can only be set via an environment variable.

This is inconvenient as every user that wants to use the application has to set some environment variables.

It would be awesome if all the environment flags could be set via the config DSL as well, maybe even via the config files.

cwrau avatar Jul 31 '23 17:07 cwrau

@cwrau I have been thinking about this issue.

This is inconvenient as every user that wants to use the application has to set some environment variables.

I don’t think this statement is true. A user needs only to set environment variables for things they want to change from the default values.

mjstrasser avatar Aug 06 '23 09:08 mjstrasser

@cwrau I have been thinking about this issue.

This is inconvenient as every user that wants to use the application has to set some environment variables.

I don’t think this statement is true. A user needs only to set environment variables for things they want to change from the default values.

You're kinda right, but I as the software developer want to change these defaults, which in this case I cannot.

Even setting aside the end users, all developers have to independently set these environment variables.

Especially for something like this which can be performance relevant.

cwrau avatar Aug 06 '23 22:08 cwrau

I think changes made last year and this cover what you want. If not, please reopen the issue with some specific requests.

mjstrasser avatar Jul 27 '24 07:07 mjstrasser

I think changes made last year and this cover what you want.

Mh, I can't seem to find anything about how to do this; https://github.com/klogging/klogging/blob/d0787ce1bcf01c2d5f9b1eebfa63654e76557f70/klogging/src/jvmMain/kotlin/io/klogging/internal/ParentContext.kt#L68-L70 is only used when https://github.com/klogging/klogging/blob/d0787ce1bcf01c2d5f9b1eebfa63654e76557f70/klogging/src/jvmMain/kotlin/io/klogging/internal/ParentContext.kt#L63 is true, which is only if the env var KLOGGING_FF_EXECUTOR_THREAD_POOL is true.

I'd like to set this directly by code

If not, please reopen the issue with some specific requests.

Should I open a new issue?

cwrau avatar Jul 29 '24 08:07 cwrau