Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

view logback logs of my web application online (HTMLLayout)

Tags:

layout

logback

I have a java 7 EE web application. For logging I am using logback. How can I see the logs, which are printed with logger.debug or logger.info in the console or a file while the application is running on a html website online in the form of a HTML table?

Is there nothing like 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 any way how I could configure my logback.xml to make all those logs available online?

like image 615
Gero Avatar asked Nov 07 '22 16:11

Gero


1 Answers

I think what you should do is log your messages into a file with HTMLLayout configuration and create a REST-Resource in your application that serves this file as response for a simple GET request. I that way you can easily access your logfiles as a web page.

As the purpos of logback is writing logs and not serving them as website, I am not aware of it that this would also be possible with a simple configuration setup.

like image 177
Simulant Avatar answered Nov 25 '22 06:11

Simulant