G-M
G-M

Reputation: 346

How to set log level for Payara Micro

I have a project where I need to run javaee7 microservice with payara micro. For this reason, I build a payara uber jar with maven, so I can just run it as

java -jar MicroService.jar

(http://blog.payara.fish/creating-uber-jar-with-payara-micro )

How can I set the logging level for payara, so that only warnings and errors are displayed, without INFO?

Upvotes: 0

Views: 3909

Answers (1)

Ondro Mihályi
Ondro Mihályi

Reputation: 7760

You can specify an alternative logging.properties file using --logProperties option followed by path to the file. This is not documented in the official documentation, but you can get a brief info about it when you execute java -jar payara-micro.jar --help.

You can find a template logging.properties file when you create a domain directory by running a plain Payara Micro with the --rootDir argument - it will copy all documentation from the JAR file into the specified folder (the folder must exist - might be empty). You can find logging.properties in config/logging.properties, take it, edit it, and pass it to Payara Micro using the --logProperties argument.

If you want to specify log levels within the uber JAR, without adding a separate logging.properties file, you may configure the logging either by running appropriate asadmin commands from within your application or directly setting log level on JUL loggers using LogManager API.

Upvotes: 5

Related Questions