View the logs of my web application’s logs on the Internet (HTMLLayout)

I have a java 7 EE web application. For logging, I use logback. How can I view the logs that are printed with logger.debugor logger.infoin consoleor filewhile the application runs on the html website online as an HTML table?

Is there nothing better than http://www.example.com/mywebapp/logback-logs.html ?

I would like to have something like the following: https://logback.qos.ch/manual/layouts.html#ClassicHTMLLayout https://logback.qos.ch/manual/configuration.html#viewingStatusMessages

Is there a way in which I can customize my logback.xml to make all of these logs available on the Internet?

+4
source share
1 answer

I think that you should write your messages to the HTMLLayout configuration file and create a REST-Resource in your application, which serves to respond to a simple GET request. Thus, you can easily access your log files as a web page.

Since the purpose of logback is to record logs and not serve them as a website, I do not know that this would also be possible with a simple configuration setup.

+1
source

Source: https://habr.com/ru/post/1685615/


All Articles