1

I run my application on the server with this command java -jar backend-server-0-SNAPSHOT-microbundle.jar --logToFile backend.log

It generates a file then I can view the "logs" through tail -f backend.log.0

The problem is it doesn't log but the thrown exceptions. In my code it have a lot of LOG.info(..) which I am expecting to view on the logs. What could be missing?

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

1

Payara documentation says that "Logging can be configured by asadmin commands (set-log-attributes, set-log-file-format, set-log-levels, delete-log-levels, …​). It can also be configured in Web Admin Console, in Configurations, under the section Logger Settings". It looks like your logging levels are not configured properly. You should set the log level to INFO. Check out the documentation https://docs.payara.fish/enterprise/docs/5.21.0/documentation/payara-server/logging/logging.html

Onur Baştürk
  • 715
  • 5
  • 15
  • Note that I am running on a Micro Bundle, running the whole server with `java -jar` not sure if you've noticed that, but basically my app does not have that Payara admin dashboard. – quarks Sep 13 '20 at 10:14
  • 1
    I noticed that already. If you can log to a file, then you can set the log levels too. Check out https://stackoverflow.com/questions/40361331/how-to-set-log-level-for-payara-micro – Onur Baştürk Sep 13 '20 at 10:30
  • Another thing is it possible to whitelist a package when using a micro bundle? – quarks Sep 13 '20 at 10:34
  • What do you mean by whitelisting a package? – Onur Baştürk Sep 13 '20 at 10:38
  • Like https://blog.payara.fish/resolving-library-conflicts-with-class-whitelisting – quarks Sep 13 '20 at 10:47
  • I see. Well actually on java web application servers, it's usually resolved changing the classloading order. Otherwise you'd have to check all libraries within your application if it has a conflict with a specific version of Payara. I don't know if there's any way to change the classloading order within a bundle but I think this document will be helpful. Check out https://docs.payara.fish/enterprise/docs/5.21.0/documentation/payara-server/classloading.html – Onur Baştürk Sep 13 '20 at 10:55