英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论