Setting log level for java.lang.System.Logger on cmdline

305 Views Asked by At

Is there a way to set the logging level for the java.lang.System.Logger on the command line? Using properties files baked into the JAR is a no-go, since I want to have the same JAR in staging and production environments with the difference that the staging environment has more verbose logging.

1

There are 1 best solutions below

1
On

Each implementation of java.lang.System.Logger works differently, so there's no uniform way to set it for all implementations.

If you happen to use SimpleConsoleLogger, you can set the environment variable jdk.system.logger.level.