We are using Log4cplus to generate logs in our Linux based home appliance. These logs are currently available on the home appliance on which a web server is running. We also show this logfile through a web browser. However since the log file is text (i.e. not in html format), the file is not formatted and it is difficult to view each log separately.
We would like to view these logs through the web server with logs formatted at html. log4j supports output logs in html format, however we have not found a way to generate html formatted logs using log4cplus. This posting is to gather ideas of how this may be possible to do this using log4cplus. Either within log4cplus or post processing but real-time since we are looking for logs in real-time.
log4cplus currently (2015-04-18) does not support HTML formatted file output in any specific way. You could sort of fake it using a layout. Or you could write your own
Appender
instance.aha Could be a starting point to produce an html file, but to get a richer formatting you could probably write some script using awk to html-ize your output.
For example, considering the following output file:
The following script will produce some valid html table based on the three first fields:
Just expand on this.
To get realtime handling, you will need to daemonize it.