0

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?

G-M
  • 296
  • 1
  • 6
  • 15

1 Answers1

4

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.

OndroMih
  • 7,280
  • 1
  • 26
  • 44
  • Resurrecting this a bit, it [seems that the format in that case is not the one that Payara Micro uses by default](https://stackoverflow.com/questions/45534984/how-does-payara-micro-determine-its-logging-format-it-differs-from-that-specifi). How, using this approach, can I get the same format as that used by Payara Micro when it starts up without arguments? – Laird Nelson Aug 06 '17 at 18:21