日志在Payara Micro捆绑包上无法正常工作。

huangapple go评论68阅读模式
英文:

Logging not working on Payara Micro bundle

问题

我使用以下命令在服务器上运行我的应用程序:java -jar backend-server-0-SNAPSHOT-microbundle.jar --logToFile backend.log

它会生成一个文件,然后我可以通过tail -f backend.log.0来查看“日志”。

问题是它只记录抛出的异常,而不记录其他日志。在我的代码中,有很多LOG.info(..),我期望在日志中看到它们。可能是什么原因呢?

英文:

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?

答案1

得分: 1

Payara文档中提到:“日志记录可以通过asadmin命令(set-log-attributes、set-log-file-format、set-log-levels、delete-log-levels等)进行配置。也可以在Web Admin控制台的“Configurations”中,在“Logger Settings”部分进行配置。” 看起来您的日志记录级别配置不正确。您应该将日志级别设置为INFO。请查阅文档https://docs.payara.fish/enterprise/docs/5.21.0/documentation/payara-server/logging/logging.html。

英文:

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

huangapple
  • 本文由 发表于 2020年9月13日 18:02:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/63869485.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定