NET Logging Library
Logging to an HTML File
Basic Tasks > Logging to an HTML File

The HTML File target automatically defaults to performing in place rolling.  After 10,000 entries are reached, older items will be discarded.  This behavior can be overridden.  The connection to the file will be automatically closed if nothing has been written to the log for one second.  The HTML Target automatically creates a log.css cascading stylesheet during startup. 

It has these properties that can be configured:

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();   
HtmlTarget target = new HtmlTarget("log.htm");       
Log.Config.Targets.Add(target);

Log.Debug("This is a test");

 

You can specify dynamic paths using these constructs:
 
Data Directory
http://stackoverflow.com/questions/1409358/ado-net-datadirectory-where-is-this-documented
|DataDirectory|\mylogfile.html

Server.MapPath for ASP.NET, Web Services, and WCF
http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.mappath.aspx
Server.MapPath("~/App_Data")\mylogfile.html

Special Folders
http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx
%ApplicationData%\mylogfile.html
%CommonApplicationData%\mylogfile.html
%LocalApplicationData%\mylogfile.html
%MyDocuments%\mylogfile.html