Setting log level doesn't seem to work

I’ve attempted setting the log level in an init script, but it doesn’t appear to be working, I’ve got the following in an init script:

init-script.gradle
def level = LogLevel.ERROR
println "Log Level: ${level}"
logging.setLevel level

It runs fine, but I’m still getting everything printed out exactly the same as I would with the default log level…what am I missing?

the loggingmanager you’re configuring here is not global but scoped to the init script. that’s why you don’t see an effect for log statements that are not done in the init script. Unfortunately there is at the moment no public api to configure this globally.

So how & where can I set the log level and expect it to work?

I’ve tried setting it in the build.gradle in the same way, to all projects and I just can’t seem to successfully set the log level at all.